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

Hide different implementations behind common interface in erlang

I have a piece of erlang code which should read some values from a db and should support a couple of dbs. I wanted my code to be somehow not dependent from the db, so I implemented two different gen_servers that register both with the same atom…
user601836
  • 3,215
  • 4
  • 38
  • 48
5
votes
1 answer

How to manage third-party erlang applications?

How do you manage erlang applications that are not part of the Erlang/OTP release ? Where do you usually install them ? If you install them aside of Erlang/OTP release, how do you tell erlang VM where to look them up (Yes, I know about -pz flag but…
Konstantin
  • 6,061
  • 8
  • 40
  • 48
5
votes
2 answers

Get current directory in erlang

I'm using chicagoboss for web development. To test some test modules I would like to change my current directory to something else. I know I can change directory by specifying full path to to cd("full path"). Suppose I'm in a directory…
user3401408
5
votes
2 answers

Write output line in standard output in Erlang

I would like to know if there is any function in Erlang for writing io:format("An output line~n"). in the standard output, without having to write ~n every time, i.e. an equivalent to Java's System.out.println("An output line"); I mean an already…
Lucia Pasarin
  • 2,268
  • 1
  • 21
  • 37
5
votes
1 answer

Errlang: no match of right hand side value

I'm getting started with Erlang, but I'm already in troubles. I copied this example from a book: -module(echo). -export([start/0, loop/0]). start() -> spawn(echo, loop, []). loop() -> receive {From, Message} -> From !…
Federico Razzoli
  • 4,901
  • 1
  • 19
  • 21
5
votes
2 answers

is_proplist in erlang?

How can get the type of a list. I want to execute the code if the list is proplist. Let us say L = [a,1,b,2,c,3, ...]. Is the list L, I'm converting it to proplist like L = [{a,1}, {b,2}, {c,3}, ...]. How can I determine whether the list is a…
Laxmikant Ratnaparkhi
  • 4,745
  • 5
  • 33
  • 49
5
votes
4 answers

Purpose of `receive after 0` (also known as Selective Receives)

From the Learn You Some Erlang for Great Good! Another special case is when the timeout is at 0: flush() -> receive _ -> flush() after 0 -> ok end . When that happens, the Erlang VM will try and find a message that fits one…
Darek Nędza
  • 1,420
  • 1
  • 12
  • 19
5
votes
1 answer

Erlang compilation: mixed of "HiPE object code" and "opcode"?

Is it possible to have a VM instance that executes both HiPE code and the usual "opcode" based objects at the same time? This question is related to : Erlang OTP release compiles with HiPE?
jldupont
  • 93,734
  • 56
  • 203
  • 318
5
votes
2 answers

Erlang record syntax with single quotes

Can someone explain the single quotes (' ') in this Erlang record syntax? #'queue.declare'{queue = <<"hello">>}
Ranjit Iyer
  • 857
  • 1
  • 11
  • 20
5
votes
6 answers

Combine/Merge Two Erlang lists

How to combine tuple lists in erlang? I have lists: L1 = [{k1, 10}, {k2, 20}, {k3, 30}, {k4, 20.9}, {k6, "Hello world"}], and L2 = [{k1, 90}, {k2, 210}, {k3, 60}, {k4, 66.9}, {k6, "Hello universe"}], now I want a combined list as : L3 = [ …
Laxmikant Ratnaparkhi
  • 4,745
  • 5
  • 33
  • 49
5
votes
2 answers

Why doesn't Erlang come with a decent package management system like gem?

Ok, this sounds like a bit of a rant, but I was wondering if there was a technical reason that Erlang doesn't have a proper package management system by default.
yazz.com
  • 57,320
  • 66
  • 234
  • 385
5
votes
2 answers

How to compile erlang code loaded into a string?

I have a generated string that contains the code for an erlang module. Is there a way to compile the generated module straight from the string? Or is there a way to convert the string into the format needed for compile:forms/1? Or will I have to…
monkey_p
  • 2,849
  • 2
  • 19
  • 16
5
votes
4 answers

Has Erlang R17 been released to the present date?

I have read in Joe Amstrong book Programing Erlang about maps as being a new feature in Erlang R17. I tried to look for for a R17 compiler but i couldn't find one. I even compiled the source from git hub but the version that erl shell reports is…
Ilie NEACSU
  • 530
  • 3
  • 12
5
votes
2 answers

How to get Peer IP Address in Nitrogen

Is is there a built in function in nitrogen framework to get Peer IP address? If not, is there a way to get the IP address of peer which is making to request to Nitrogen App
Shree Kavi
  • 65
  • 4
5
votes
2 answers

Erlang Frontend

I am building an erlang environment which is managing a single app distributed across the networks running Linux. Any thoughts on what will be the best way to build a frontend such as in VB.Net or CSharpe for this server. I guess the main thought is…