Erlang: what is the difference between “include_lib” and “include”?

The way the documentation describes the difference between include and include_lib is: include_lib is similar to include, but should not point out an absolute file. Instead, the first path component (possibly after variable substitution) is assumed to be the name of an application. Example: -include_lib(“kernel/include/file.hrl”). The code server uses code:lib_dir(kernel) to find the directory of … Read more

How to call a method dynamically in Elixir, by specifying both module and method name?

You can use apply/3 which is just a wrapper around :erlang.apply/3. It simply invokes the given function from the module with an array of arguments. Since you are passing arguments as the module and function names you can use variables. apply(:lists, :nth, [1, [1,2,3]]) apply(module_name, method_name, [1, array]) If you want to understand more about … Read more

RabbitMQ (beam.smp) and high CPU/memory load issue

Finally I found the solution. These posts helped to figure this out. RabbitMQ on EC2 Consuming Tons of CPU and https://serverfault.com/questions/337982/how-do-i-restart-rabbitmq-after-switching-machines What happened was rabbitmq was holding on to all the results that were never freed to the point it became overloaded. I cleared all the stale data in /var/lib/rabbitmq/mnesia/rabbit/, restarted rabbit and it works … Read more

What is the best way to learn Erlang?

I’m a month-or-so into learning and the guides I’m enjoying most are: The Erlang Site’s Getting Started with Erlang Guide Joe Armstrong’s Book Software for a Concurrent World (thoroughly recommended) And I have on order: O’Reilly’s Erlang Programming which has had some really positive reviews and sounds like a good companion to Joe Armstrong’s book … Read more

How does akka compare to Erlang? [closed]

Disclaimer: I am the PO for Akka Erlang does copy-on-send – Akka uses shared memory (immutable objects) for in-VM sends Erlang does per-process GC – Akka uses JVM GCs Erlang has OTP – Akka integrates with the entire Java ecosystem (Apache Camel, JAX-RS, etc etc) Erlang does the process scheduling for you – Akka allows … Read more