[erlang-questions] Forget Erlang on the Java VM. More language on the Erlang VM are needed!

Richard Carlsson <>
Fri Nov 30 11:13:58 CET 2007


Bjorn Gustavsson wrote:
> Don't use Kernel Erlang. It is an internal format that may change at any time,
> and it is entirely undocumented.

Also note that it is not at all strictly necessary; it is basically a kind
of "intermediate convenience format" used by the Beam compiler when going
from Core Erlang down to Beam code (and it's not the only such format
either; there are a couple of other entirely undocumented more-or-less
Beam-like representations before you get to actual Beam assembler).

The HiPE native code compiler, when compiling from Erlang source code, goes
directly from the Core Erlang level (which is the last common step for Beam
and HiPE) to an assembler-like intermediate format called Icode. This is
further translated down to an abstract register transfer language and then
mapped to target machine code. We try to do as much as possible on the
functional Core language before going to a basic block representation.

If you want to experiment with the Erlang VM as a backend for some other
language than Erlang, I'd recommend (in this order, and depending on what
level of detail you need to be able to get down to):

   1. Core Erlang
   2. Beam
   3. Icode (currently only for generating native code)

All of these are stable, more or less documented, and _sensible_
representations of Erlang code. Dig around in the source code for the
Beam and HiPE compilers (lib/{compiler,hipe}/src) for details.

     /Richard






More information about the erlang-questions mailing list