Here’s an introduction to distribution in Erlang. This screencast demonstrates creating three Erlang nodes on a Windows box and one on a Linux box and then connecting them using the one-liner “net_adm:ping” to form a mighty compute cluster.
- Using erl to start an Erlang node (an instance of the Erlang runtime system).
- How to use net_adm:ping to connect four Erlang nodes (three on Windows, one on Linux).
- Using rpc:call to RickRoll a Linux box from an Erlang node running on a Windows box.
- Using nl to load (deploy) a module from one node to all connected nodes.
Special treat: If you ever wondered how I talk when I’m very sleepy here’s your big chance.
In 2007 when I keyed my first “HelloWorld.erl” in Notepad, I remember a general uneasiness descending over me.
I’m typing code in Notepad.
Notepad doesn’t have syntax highlighting.
Notepad doesn’t provide error squiggles.
Notepad doesn’t provide IntelliSense.
Notepad doesn’t have a “Build Solution”.
How am I supposed to set a breakpoint from Notepad?
How am I supposed to debug this stuff?
Oh, dark night of the soul! What am I getting into here!?
Well here’s an answer to at least the debugging bit…
This screencast is a simple demo of debugging (stepping through) a recursive function in an Erlang module. For grins, and to make it clear that no IDE magic is involved, the code is edited using Notepad.
My plan is to release a new “Erlang for .NET Developers” screencast each week. Most will follow this simple “answer to common questions” format. In the next one, I’ll show my Emacs Erlang rig (with syntax highlighting, error squiggles, auto-completion) in action. From there I will work down a list of questions that O.J. Reeves (@TheColonial) and I have accumulated. The two of us are drafting a book with the working title “Erlang for .NET Developers”. If you are a .NET developer and learning Erlang, we would love to see your questions. Please post them as comments or via Twitter.