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

How to ensure fast startup times of mnesia

Erlang with mnesia/dets is famous for it slow startup times after a crash. Basically the same issue as with fsck on older filesystems. But I also experience slow startup times after regular shutdowns: about 8 Minutes for 250 MB on-disk data on a…
max
  • 29,122
  • 12
  • 52
  • 79
5
votes
2 answers

How do I infer the current timezone in Elixir or Erlang?

Is there a way in Elixir or Erlang to print out the name of current timezone? I know that I can get the local time in Elixir by calling the Erlang Calendar module. :calendar.local_time and I can get the current time in UTC in Elixir by using the…
Ken Anderson
  • 2,403
  • 2
  • 13
  • 7
5
votes
2 answers

rebar3 generate edoc for multiple apps

If I have an OTP layout like this: foo/ - apps/ - bar1/ - src/ - bar2 - src/ How can I generate edoc for both bar1 and bar2? If I run: rebar3 edoc what I get is separate .html files in bar1/doc and bar2/doc, and none of the…
Andriy Drozdyuk
  • 58,435
  • 50
  • 171
  • 272
5
votes
1 answer

Why is factorial not overflowing the stack in Erlang?

-module(demo). -export([factorial/1]). factorial(0) -> 1; factorial(N) -> N * factorial(N-1). The factorial is not tail recursive but why is it not overflowing the stack? I am able to get factorial of 100,000 without stack overflow but takes…
user235273
5
votes
1 answer

Forcing erl -make to recompile files when macros are changed

I tried to do something similar to How to make two different source directories in a Makefile output to one bin directory?, so I have these files (relative to my project root): Emakefile: % EMakefile % -*- mode: erlang -*- {["src/*", "src/*/*",…
Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487
5
votes
1 answer

Erlang VM killed when creating millions of processes

So after Joe Armstrongs' claims that erlang processes are cheap and vm can handle millions of them. I decided to test it on my machine: process_galore(N)-> io:format("process limit: ~p~n", [erlang:system_info(process_limit)]), …
Sharas
  • 860
  • 8
  • 18
5
votes
2 answers

Missing ecto association between models

I'm following the "Programming Phoenix" book by Chris McCord and in Chapter 6, a relationship is created between a User and a Video. When trying to run it with mix phoenix.server, the following error shows up: Request: GET /manage/videos ** (exit)…
Henrique
  • 4,921
  • 6
  • 36
  • 61
5
votes
1 answer

Where can I get the latest specification of Erlang BEAM VM?

I want to read the instruction set for the BEAM VM and learn its internals, but what I can find with google is all out-dated.
huron
  • 762
  • 1
  • 5
  • 22
5
votes
2 answers

Bad value on output port 'tcp_inet'

I'm using the Phoenix framework, which is running Cowboy underneath. I am occasionally seeing the following pair of errors in my log: Bad value on output port 'tcp_inet' GenServer #PID<0.8423.1> terminating ** (FunctionClauseError) no function…
Matt
  • 84,419
  • 25
  • 57
  • 67
5
votes
1 answer

Connection closed - strange error, unable to connect from erlang VM to certain host

IMPORTANT Proved that migration from 18.3 to 18.3.4 causes this issue, and migration back to 18.3 removes it. Everything worked until one moment. Then it just stoped to work. def work do HTTPotion.get("https://ssl-third-party.com", …
Joe Half Face
  • 2,303
  • 1
  • 17
  • 45
5
votes
2 answers

When to use macros functions in Erlang?

I'm currently following the book Learn You Some Erlang for Great Good by Fred Herbert and one of the sections is regarding Macros. I understand using macros for variables (constant values, mainly), however, I don't understand the use case for macros…
carbon_ghost
  • 1,114
  • 5
  • 18
  • 40
5
votes
1 answer

Can I run an escript app from rebar3?

After creating an escript app: $ rebar3 new escript hello Can I run with with rebar3, instead of calling escriptize first? I.e. something like this? $ rebar3 run
Andriy Drozdyuk
  • 58,435
  • 50
  • 171
  • 272
5
votes
1 answer

What are benefits of using RabbitMQ in Erlang?

I am learning Erlang and I came from a good Python background. I used RabbitMQ with Celery in my projects. While Erlang has a very powerful messaging and concurrency capabilities, what are benefits of using RabbitMQ with Erlang? Am I missing the…
Farshid Ashouri
  • 16,143
  • 7
  • 52
  • 66
5
votes
3 answers

Are most Erlang applications such as MochiWeb, Riak, RabbitMQ, Zotonic, ejabberd and CouchDB OTP applications?

Just started reading the OTP chapter on the great Erlang book by Francesco Cesarini. Are most Erlang applications such as MochiWeb, Riak, RabbitMQ, Zotonic, ejabberd and CouchDB OTP applications?
Gaius Parx
  • 1,065
  • 1
  • 11
  • 18
5
votes
1 answer

Erlang - case construction

I'm new to Erlang and I've tried some Erlang constructions. My program should behave something like that: if x == 42: print "Hi" else: print "Hello" Here is my code in Erlang -module(tested). -export([main/0]). main() -> {ok, X} =…
szemek
  • 53
  • 3