Thursday 7 November 2013

See How It Runs!

The Erlang compiler erlc compiles Erlang code into semicompiled code that runs on a virtual machine.  Each module of code occupies one file of source code with the extension .erl and compiles to byte code in a file with extension .beam.  The beam files are executed by a virtual machine under there somewhere.

You can load these into the Erlang Shell for evaluation.

However there is also a modest tool called escript that will execute a file of raw Erlang code if you write it up appropriately - with this you can try out a few short Erlang scripts, maybe open your Kernighan & Ritchie and imagine it's like C.

The REPL interface is fine for its purpose but I also like the DBM/JDI user interface (Don't Bother Me, Just Do It).

Escript will also execute compiled code if you set it out correctly. So someone could issue an Erlang application as a compiled escript file (which is where this is heading...).

No comments:

Post a Comment