debuggingerlangcoding-efficiencyerl

Speeding up the Erlang Edit, Compile, Run/Debug cycle


What is the fastest way to edit an Erlang application, compile the code and see the running result? Preferably jumping in the Erlang shell on the last step.

My current newbie setup:

Is there a faster way? BTW. my editor of choice is Emacs.


Solution

  • Here's my setup:

    There's rarely a need to restart the whole Erlang application. Reloading changed modules is a more common use-case and it is usually enough to apply your changes.

    Regarding application start: if your application depends on other applications, application:start() will fail, until you start all the dependencies. Because of that, it is common to write a helper function <your-app-name>:start(). Here's an example. Another useful function is <your-app-name>:stop().

    With all these techniques applied, a workflow would look like this: