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
31
votes
4 answers

How to generate integer ranges in Erlang?

From the other languages I program in, I'm used to having ranges. In Python, if I want all numbers one up to 100, I write range(1, 101). Similarly, in Haskell I'd write [1..100] and in Scala I'd write 1 to 100. I can't find something similar in…
Rafe Kettler
  • 75,757
  • 21
  • 156
  • 151
31
votes
3 answers

Python/Erlang: What's the difference between Twisted, Stackless, Greenlet, Eventlet, Coroutines? Are they similar to Erlang processes?

My incomplete understanding is that Twisted, Stackless, Greenlet, Eventlet, Coroutines all make use of async network IO and userland threads that are very lightweight and quick to switch. But I'm not sure what are the differences between them. Also…
Continuation
  • 12,722
  • 20
  • 82
  • 106
31
votes
3 answers

How do I run a beam file compiled by Elixir or Erlang?

I have installed Erlang/OTP and Elixir, and compiled the HelloWorld program into a BEAM using the command: elixirc test.ex Which produced a file named Elixir.Hello.beam How do I run this file?
Samuel Lampa
  • 4,336
  • 5
  • 42
  • 63
30
votes
2 answers

Best practices/conventions for writing Erlang unit tests using eunit

I'm currently learning Erlang and was wondering about what are some good practices or conventions for unit testing? I am currently using eunit. To frame this question: I'm currently writing one unit test module for each function, that way my test…
stantona
  • 3,260
  • 2
  • 24
  • 28
30
votes
2 answers

In Erlang how do I convert a String to a binary value?

In Erlang how do I convert a string to a binary value? String = "Hello" %% should be Binary = <<"Hello">>
yazz.com
  • 57,320
  • 66
  • 234
  • 385
30
votes
5 answers

Achieving code swapping in Erlang's gen_server

I am looking to make use of Erlang's hot code swapping feature on a gen_server, so that I don't have to restart it. How should I do that? When I searched, all I could find was one article which mentioned that I need to make use of…
jeffreyveon
  • 13,400
  • 18
  • 79
  • 129
30
votes
4 answers

Garbage collection and memory management in Erlang

I want to know technical details about garbage collection (GC) and memory management in Erlang/OTP. But, I cannot find on erlang.org and its documents. I have found some articles online which talk about GC in a very general manner, such as what…
user1002288
  • 4,860
  • 10
  • 50
  • 78
29
votes
3 answers

Why is Erlang said to be more suited for server side programming in webgames than Java and C++?

I don't really understand, how can Erlang be more efficient than C++?
ieplugin
  • 661
  • 1
  • 7
  • 12
29
votes
3 answers

Why is useful to have a atom type (like in elixir, erlang)?

According to http://elixir-lang.org/getting-started/basic-types.html#atoms: Atoms are constants where their name is their own value. Some other languages call these symbols I wonder what is the point of have a atom type. Probably to help build a…
mamcx
  • 15,916
  • 26
  • 101
  • 189
28
votes
2 answers

Elixir - is there a performance penalty using it instead of plain erlang?

Elixir seems cool but I wonder about the downsides.. if any.. Are there any other potential downsides when choosing it over erlang ?
GabiMe
  • 18,105
  • 28
  • 76
  • 113
28
votes
5 answers

How to format a number with padding in Erlang

I need to pad the output of an integer to a given length. For example, with a length of 4 digits, the output of the integer 4 is "0004" instead of "4". How can I do this in Erlang?
rwe
27
votes
10 answers

Functional languages (Erlang, F#, Haskell, Scala)

Are functional languages suited for web applications development? Are functional languages suited for business/ERP/CRM type of applications?
Michael Ellick Ang
  • 1,128
  • 1
  • 9
  • 18
27
votes
6 answers

TCP-based RPC server (Erlang or something similar?) for iOS/Android app communication

I'm building native mobile applications in both iOS and Android. These apps require "realtime" updates from and to the server, same as any other network-based application does (Facebook, Twitter, social games like Words with Friends, etc) I think…
randombits
  • 47,058
  • 76
  • 251
  • 433
27
votes
7 answers

Hosting for erlang application

Is there erlang hosting anywhere?
0xAX
  • 20,957
  • 26
  • 117
  • 206
27
votes
2 answers

Package management on Erlang and Elixir

I searched for package management on Erlang and Elixir and got some pointers to rebar rebar3 mix hex and relx etc. Can you help clarify the relationships among them? Where to use what? Is package just synonym to Erlang's application made up of…
sof
  • 9,113
  • 16
  • 57
  • 83