How do you organize your erlang workflow? I'm learning some Erlang now and I'm using Rebar, recompiling, rebuilding and restarting an entire release (I'm trying to keep things OTP'ish) after each edit. I'm pretty sure that there is a smarter way to do this.
In Etorrent, I am using a little trick you may like:
When you have built a development release, you can execute the command make console
which has the following definition:
console:
dev/etorrent-dev/bin/etorrent console \
-pa ../../apps/etorrent/ebin
basically, it uses the release ebins for most stuff, but overrides the application ebin to be outside at the point where you normally build the software. Now, running a console, you can edit your code, run make
(I hit a key combination in Emacs), fix errors, run make
again and so on. When you are satisfied with your change, you go into the console (erlang shell) and execute l(ModuleToLoad)
at which point the running system gets the new code injected. OTP will automatically pick up the hot-deployed code change and alter the processes. Essentially you only have to restart fairly rarely when working on the code.
Nowadays, we also have tests, so you can execute make test
in etorrent to have the test framework run on your newly formed code before injection if you want a bit more guarantee that the new code works.
With Chicago Boss you just hit "Refresh" in your web browser:
http://www.chicagoboss.org/
Even if your goal isn't web development, it might be a way to learn Erlang that is more fun than your current workflow. CB pretty-prints compilation and run-time errors right in the browser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With