[erlang-questions] dynamic module compilation

Robert Virding <>
Tue Jun 10 01:10:46 CEST 2008

2008/6/9 Howard Yeh <>:

> On 6/9/08, David Mercer <> wrote:
> > On Sunday, June 08, 2008, Howard Yeh wrote:
> >  > see ERTS manual chapter 4 to see the abstract format.
> >  >
> >  > http://www.erlang.org/doc/apps/erts/part_frame.html
> >  >
> >  > there's also Core Erlang. But I am not sure where it's documented.
> >
> >
> > What are the arguments for using one over the other?
> I started working with Serl (the "other" Lisp front end one should not
> speak of) not knowing the erlang compiler takes Core Erlang.
> Reading Robert's LFE, it looks like using Core Erlang makes cleaner
> code, as it's just a bunch of records. Building erlang abstract syntax
> isn't very friendly.
> On the other hand, erl_syntax and erl_syntax_lib are very helpful. To
> do lambda lifting for letrec I just used the binding analysis included
> in erl_syntax. There's also map tree, fold tree, etc in erl_syntax. I
> think Core Erlang also has binding analysis included, but not the
> mapping, folding stuff. And Core Erlang isn't "extensible". erl_syntax
> is purportedly "extensible", but most of the functions don't work on
> custom syntax types.
> then again, Core Erlang has letrec, so had I used it, I wouldn't have
> to get into all the hairiness that is lambda lifting. On yet another
> hand, Core Erlang is pretty minimal. I think you have to do your own
> list comprehension, for example.
> just my 2 cents.

Yes, Core erlang is a very simple, minimal functional language. You really
have to do most things yourself. The benefit of using it is that it is
simple and minimal so it is really very easy to generate. Strangely the only
thing missing is non-recursive local functions. Well, not so strange really
as Core was developed to compile erlang and only recursive local functions
are really needed for that. Actually for just list/binary comprehensions.
Comprehensions are easy to compile by the way.

One very useful thing which Core does handle is patterns, these are in the
Core language so you don't have to worry about compiling them.

The only documentation I know of is a paper written by Richard Carlsson.
This together with the record definitions and some examples will be enough
for most things.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080610/ea3ff795/attachment.html>

More information about the erlang-questions mailing list