[erlang-questions] Erlang VM Documentation

43 views
Skip to first unread message

Riccardo Massari

unread,
Feb 27, 2012, 11:34:13 AM2/27/12
to erlang-q...@erlang.org
Hi everyone,

I'm a newbie of the Erlang world and I have a question:

"Is there an official Erlang VM Documentation?"

I need opcodes description and best practices, to use the VM properly
in order to build a Python-Erlang (beam) compiler for a university exam.
I found a blog listing opcodes [1], a PDF with the history of the
Erlang VM [2] and
something else but nothing exhaustive and complete.

Am I searching in the wrong way? Can you help me?

Thank you in advance!

[1] http://azunyanmoe.wordpress.com/2011/03/30/erlang-vm-opcodes
[2] http://www.erlang-factory.com/upload/presentations/247/erlang_vm_1.pdf

_______________
Riccardo Massari
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

Tony Rogvall

unread,
Feb 27, 2012, 12:36:45 PM2/27/12
to Riccardo Massari, erlang-q...@erlang.org
I started a small beam project a couple of years ago.
The aim was to document and give semantics to beam instruction using Erlang.

You can find it here:


using beam_emu:run(Mod, Func, Args)  you can even run simple beam code,
it is complete and may never be, but can serve as inspiration?

/Tony

"Installing applications can lead to corruption over time. Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix"



Robert Virding

unread,
Feb 27, 2012, 4:35:24 PM2/27/12
to Riccardo Massari, erlang-q...@erlang.org
I would seriously consider compiling to Core Erlang instead. It is a simple functional language inside the compiler. The compiler is designed so it can take Core code as input. Most of the compiler optimisations are done on Core so having that as your target gives you this "for free". Most legal things you can do in BEAM assembler you can reach through Core. It is actually quite a nice little language. There are a number of tools which work on Core. The language has changed very little and a description of it can be found at:

http://www.it.uu.se/research/group/hipe/cerl/

Robert

Tim Watson

unread,
Feb 27, 2012, 7:46:37 PM2/27/12
to Robert Virding, erlang-q...@erlang.org
Wow, so Core appears to have 'let' and 'letrec' - I would give limbs to have that in Erlang proper. Well maybe not, but I would *really* like it. Also 'do' is interesting, as seems to make more sense of expressions that are only evaluated for their side effects.

Why don't we have let, letrec and do in the full language?

Reply all
Reply to author
Forward
0 new messages