BEAM documentation (was Re: Packages in Erlang...)

Thomas Lindgren thomasl_erlang@REDACTED
Mon Sep 8 20:36:10 CEST 2003


--- James Hague <jamesh@REDACTED> wrote:

> 2. Move most of the code from the "beam_load.c"
> module to the Erlang
> compiler.  This is the module that replaces generic
> BEAM instructions with
> specialized instructions.  This code would be much
> cleaner in Erlang than in
> C, and it would also simplify the emulator
> (beam_load.c is the second
> largest module in the emulator).

Bit syntax + magic extra BIFs for linking in code
might do the trick.

However, I'm not sure you need the detour of going
through BEAM if you are doing your own implementation
anyway. Some other options might be to write a backend
for Core Erlang (I think Richard C. has been looking
at this) or to write your own HIPE frontend.

Though you are still stuck with the standard runtime
system if you do this, which is a drawback if we want
to do a "second-source".

For an experimental code generator, generating .s
files and statically linking them with a runtime
system .so could work just fine. Perhaps one could use
dlopen() and friends to do full dynamic linking, even.
Or write a suitable new dynamic linker (e.g., parse
ELF in Erlang, etc.) (Paging Tony Rogvall ... :-)

Best,
Thomas


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the erlang-questions mailing list