Re:Core Erlang by Example
by jacquesm on Monday May 07, 2018 @05:44PM
(#17016714)
Erlang is the top level user visible language. This gets transformed through several steps to at some point Core Erlang, which ultimately gets transformed into a binary representation that BEAM can interpret.
The only benefit is that it is easier for a machine to do the transformation from Core Erlang to BEAM bytecode than it would be if that machine would have to transform Erlang in one go, similar to how a C compiler will first make a tree like representation of the program in memory, will then convert that tree into some assembly (or a meta assembly language that is still platform independent) which will then be converted to binary. Each of those stages has a corresponding equivalent in the Erlang domain:
Erlang -> C
Abstract Format -> AST
Core Erlang -> Assembler
BEAM Bytecode -> binary
The equivalence is obviously not exact but good enough for this explanation.
The only benefit is that it is easier for a machine to do the transformation from Core Erlang to BEAM bytecode than it would be if that machine would have to transform Erlang in one go, similar to how a C compiler will first make a tree like representation of the program in memory, will then convert that tree into some assembly (or a meta assembly language that is still platform independent) which will then be converted to binary. Each of those stages has a corresponding equivalent in the Erlang domain:
Erlang -> C
Abstract Format -> AST
Core Erlang -> Assembler
BEAM Bytecode -> binary
The equivalence is obviously not exact but good enough for this explanation.