Questions tagged [erlang]

Erlang is a general-purpose, garbage-collected programming language and runtime environment, with built-in support for concurrency, distribution and fault tolerance.

Erlang is a general-purpose functional programming language and runtime environment. It has built-in support for concurrency, distribution and fault tolerance. Erlang is used in several large telecommunication systems from Ericsson. Erlang is open source and available for download on GitHub.

Some Erlang features:

Online Resources:

Erlang Books:

9600 questions
5
votes
2 answers

Binary operations on Erlang binaries?

What's best way to do the following? Binary -> list -> binary seems unnecessary. binary_and(A, B) -> A2 = binary_to_list(A), B2 = binary_to_list(B), list_to_binary([U band V || {U, V} <- lists:zip(A2, B2)]).
me2
  • 3,069
  • 2
  • 26
  • 33
5
votes
1 answer

What is Mnesia replication strategy?

What strategy does Mnesia use to define which nodes will store replicas of particular table? Can I force Mnesia to use specific number of replicas for each table? Can this number be changed dynamically? Are there any sources (besides the source…
citxx
  • 2,525
  • 17
  • 40
5
votes
3 answers

How to check whether the process was restarted by supervisor?

To be more precise: I have a supervisor for dynamic number of children. I want it to use different init function when given child is added and started for the fist time than for all the restarts than will happen later. Optionally, I could use the…
Radosław Łazarz
  • 950
  • 1
  • 11
  • 25
5
votes
2 answers

Same Machine Erlang communication

I need an answer to the following question to help understand what approach I should be taking to interface with Erlang. AFAIK Erlang on a SMP UNIX box uses the multi-process approach. In this case it should do same machine IPC. Does Erlang use…
Hassan Syed
  • 20,075
  • 11
  • 87
  • 171
5
votes
5 answers

Erlang: gen_server or my own custom server?

I need to write a server that will receive instructions from other modules and take actions depending on the instructions received. Efficiency is my main concern. So do I use gen_server or do I write my own server. By "my own server" I mean…
ErJab
  • 6,056
  • 10
  • 42
  • 54
5
votes
5 answers

Erlang : Breaking out of lists:foreach "loop"

I have a list of elements in Erlang, and I'm using lists:foreach to traverse through the elements in the list. Is there a way to break out of this "foreach loop" in the middle of the traversal. For eg: suppose I want to stop traversing the list…
ErJab
  • 6,056
  • 10
  • 42
  • 54
5
votes
9 answers

It's a good idea use ruby for socket programming?

My language of choice is Ruby, but I know because of twitter that Ruby can't handle a lot of requests. It is a good idea using it for socket development? or Should I use a functional language like erlang or haskell or scala like twitter developers…
Werner Echezuria
  • 612
  • 1
  • 10
  • 23
5
votes
1 answer

Sending binaries in Erlang over TCP

Using the code below to send. The gen_tcp:send call returns {error,einval} but I can't figure out why... -define(TCP_OPTIONS,[binary, {active, false}, {reuseaddr, true}]). client() -> case gen_tcp:connect(to_Server(), 8080, ?TCP_OPTIONS) of …
Nolan
  • 53
  • 3
5
votes
1 answer

Why isn't andalso/2 implemented as a proper BIF?

I'm able to write prefix boolean expressions like erlang:'and'(true, false), but not the corresponding andalso or orelse expressions. Why? When I look at the core output, it looks like andalso and orelse are just macros - for example: a(A,B) -> A…
amindfv
  • 8,438
  • 5
  • 36
  • 58
5
votes
3 answers

Truncated error report in erlang

Warning: erlang n00b ahead. I'm trying to get a grasp of erlang, and just trying a basic hello world application with cowboy. I'm simulating an error, basically returning an invalid value somewhere in my code, and trying to interpret the error,…
Matt
  • 1,313
  • 4
  • 17
  • 27
5
votes
2 answers

passing events from erlang to Clojure

I'm looking for a way to pass events back and forth between Clojure and erlang. has someone done this before? how should I encode the (immutable) messages in a flaxable general way? Should IPC be used for this? what sort? where has this gone wrong…
Arthur Ulfeldt
  • 90,827
  • 27
  • 201
  • 284
5
votes
1 answer

Erlang: Location of *.hrl files in multiple applications

I'm developing a series of related applications that will eventually be integrated into a single release. Several of the applications share identical record structures. Should I: a) Duplicate the *.hrl files that define the record structure in the…
Lloyd R. Prentice
  • 4,329
  • 3
  • 21
  • 31
5
votes
3 answers

RabbitMQ server error

UPDATED error message I am getting a BOOT FAILED error every time I try to start the rabbitmq server. Does anybody know how I can fix this? I have attached the error message. I have tried a few different things including uninstalling and…
user2540882
  • 51
  • 1
  • 1
  • 3
5
votes
1 answer

How to use ssh_connection:exec in Erlang?

This is an interesting situation, focused on the behavior of erlang ssh modules. I had spent a few hours troubleshooting a problem that turned out to reveal that the Erlang ssh_connection *exec/4* function operates asynchronously. If you issue the…
gextra
  • 8,439
  • 8
  • 40
  • 62
5
votes
3 answers

Function clause error when using exmpp function

Previously I was using xml:get_tag_attr_s("type", Packet) for that debug line in ejabberd 2.1.10, but that is not working anymore in ejabberd 13.03. Probably because it is deprecated according to the docs…
Kay Tsar
  • 1,428
  • 11
  • 14
1 2 3
99
100