Erlang bytecodes and/or VM description?

Thomas Lindgren <>
Fri Jun 2 11:03:32 CEST 2006



--- David Hopwood
<> wrote:

> This might seem like a pointed question, but I'll
> ask it anyway:
> how does one maintain a VM without accurate
> documentation of the
> executable format it implements? I know I couldn't
> do it.

(You might be appalled by the state of the art :-)

Well, first of all, this documentation may be partial,
informal, written in swedish, or otherwise mostly
intended for internal use. Or reading some of the code
might be necessary. Recall that extensive 'formal'
documentation also needs maintenance, and easily
becomes a drag on development. (For beam, the basic
file format is documented

http://www.erlang.se/~bjorn/beam_file_format.html

but I haven't seen any docs on the instruction set in
a long time.)

Second, the low-level instruction set can be in part
implemented by a DSL. I believe this is a common
approach when merging VM instructions, for example.
Documenting the formats of autogenerated instructions
is not so useful in practice. (Been there, read that
:-)

Third, there often are tools to slice and dice the
generated code (in object form or when loaded). Using
the tools and familiarizing oneself with their
internals might be sufficient to learn.

Fourth, experienced implementors may actually not need
a lot of documentation of these things. And you won't
be parachuted into maintaining beam without first
getting some experience.

In summary, not an ideal situation for a new beam
developer, but nor would I say it is hopeless. In
practice, I prefer higher-level documentation myself;
once you understand the VM principles (assuming there
are any), the rest tends to sort itself out.

Best,
Thomas


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the erlang-questions mailing list