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