[erlang-questions] Sexp front end for Erlang?

Peter Mechlenborg peter@REDACTED
Tue Oct 17 16:49:45 CEST 2006


Garry Hodgson wrote:
> Peter Mechlenborg <peter@REDACTED> wrote:
>
>   
>> At the company I work for, we have recently started implementing a 
>> domain specific language with an Erlang back end and have a prototype 
>> compiler written in Common Lisp.  Instead of generating Erlang source 
>> code directly, the compiler has two phases with an sexp layer in 
>> between, that is, the first phase in the compiler generates sexp's 
>> corresponding to Erlang code, and the second phase generates Erlang 
>> source code from the sexp's.
>>     
>
> i can't answer your question, but i'm curious why you didn't just develop
> the compiler in erlang?  seems like it would've been simpler, and easier
> to integrate with the back end functionality you want.
>   
Well, mostly because I like Common Lisp a lot, although I must confess 
that Erlang has gained a lot on CL since I started using it, it's a 
great language.  Another reason for doing it in CL was that the 
prototype dsl uses sexp's as syntax, so I didn't have to build a parser. 
(I could probably have used Erlang terms instead of sexp's to get the 
same advantage, and building the dsl as an internal language in Erlang 
might have made somethings easier, but I also think it would have made 
the coupling between the dsl and the back end stronger than we would want).

I think that an sexp-erlang might be a fun idea, particularly in 
connection with macros, but then again, it might just be me having crazy 
thoughts :-).

Have fun,

  --  Peter



More information about the erlang-questions mailing list