[erlang-questions] concurrency developments

Robert Virding <>
Thu Jan 17 22:43:10 CET 2008


On 17/01/2008, Richard Carlsson <> wrote:
>
> This page has the most up-to-date Core Erlang specification,
> and some info on how to compile to/from Core source code:
>
>    http://www.it.uu.se/research/group/hipe/cerl/
>
> The Core Erlang representation is an important intermediate
> step for the BEAM compiler, and the HiPE compiler can generate
> native code directly from Core Erlang as well as from BEAM.


Have missed those papers, they're quite readable. The only bit which is
missing is a description of the binary/bitstring parts.

If you are going to compile to Core then you need the following files as
help:

<erlang>/lib/compiler-?.?/src/
    core_parse.hrl
    core_lint.erl
    core_pp.erl

Core_parse.hrl contains the record definitions of the AST of Core and
together with appendix  C "Syntax tree representation" (in the 1-0-3 paper)
give a description of how to build Core code in abstract form. Then it's
just core_lint it to be sure and run it in to the back-end of the compiler
to generate module. Works really well.

The list of annotations are just annotations but some have special meaning,
especially a first anno in the list of an integer which is taken to be the
line number and used in core_lint error messages.

The best way to truly understand how it all fits together is to generate
core code "c(foo,[report,to_core])" and stare at it a bit. Most becomes
clear then.

Guards can be a little tricky.

One major benefit of compiling to core, apart from it being a nice little
language, is that you get some significant optimisations done for you in the
back-end. A major one is the pattern-matching compiler which works on core
code. This is a Big Win and while not really hairy code can be tricky to get
right.

Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080117/0edd94dc/attachment.html>


More information about the erlang-questions mailing list