[erlang-questions] how: Building Core Erlang abstract syntax trees

Bjorn Gustavsson bjorn@REDACTED
Mon Jun 2 09:45:50 CEST 2008


> 2008/5/31 Richard Carlsson <richardc@REDACTED>:
> >
> > This is for historical reasons. When we started working on Core Erlang,
> > Robert (and others) preferred working directly with records, while I
> > preferred using a "proper" abstract datatype (even though it meant
> > that I couldn't decompose structures using pattern matching). Also,
> > we had some different ideas regarding how some things such as literals
> > and variables ought to be represented. So you'll find that the central
> > parts of the compiler use the records defined in core_parse.hrl, while
> > cerl_inline and everything in lib/hipe/cerl uses the cerl.erl ADT (which
> > can be converted to/from the record format).

In a future release we will probably unify the the Core Erlang formats,
so that the cerl functions can be used directly on the records.

Also, already in R12B, some of the semantic differences between the Core
Erlang formats have been removed. For instance, literals are now represented
in the same way (that was needed to implement the constant/literal pool in
R12B).

/Bjorn
-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list