[erlang-questions] beta release of merl - metaprogramming in Erlang

Thomas Lindgren thomasl_erlang@REDACTED
Tue Feb 4 15:04:56 CET 2014


I chortled at the homoiconic languages slide. Then chortled again at seeing you have nearly grasped in your hands the holy grail of programming: compiling power point.

Anecdote time. I looked at another point of the curve you're describing: I extended the erlang parser with syntax tree fragments and holes wherein to plug the fragments (fragments could have holes too of course). The idea was that you could specify in "Template Erlang" that, say, this function takes 0,1 or more extra arguments using something like @, Lisp macros, or that you can add clauses to this case, or that you can plug in an expression right here, etc. There were various plug-in points throughout the syntax tree. Fragments could be all major syntactic elements, like functions, attributes, clauses, expressions, patterns, and so on.

The main gains of that approach compared to what (after a quick read) looks like textual templating in Merl appears to be guaranteed syntactic well-formedness and possibly adding a little bit more "type checking" to make sure that fragments and holes fit. In retrospect I'm not sure Template Erlang was worth the effort since it felt a bit too unwieldy in practice. Text templates might be quite sufficient in practice (and easier to use).

Best,
Thomas




On Tuesday, February 4, 2014 12:55 PM, Richard Carlsson <carlsson.richard@REDACTED> wrote:
 
So, I finally got around to releasing Merl to Github, under an Apache 2 
>license:
>  https://github.com/richcarl/merl
>
>I talked about it two years ago in San Francisco:
>  http://www.youtube.com/watch?v=RA7QcMNBKfg
>
>Slides here:
>
>http://www.erlang-factory.com/conference/ErlangUserConference2012/speakers/RichardCarlsson
>
>See the edoc overview for documentation, and the examples/ subdirectory 
>for example code.
>
>Currently missing: I'd like to have a good API for working with a 
>"module" as an ADT, easily adding and removing definitions and querying 
>the current state, and also reading an existing module from file or as 
>an AST in a parse transform. The file "examples/merl_build.erl" is a 
>start, but I don't have time right now to work more on that. Useful 
>sources of inspiration for such an API are 
>https://github.com/yariv/erlyweb/blob/master/src/smerl/smerl.erl and 
>https://github.com/uwiger/parse_trans.
>
>   /Richard
>_______________________________________________
>erlang-questions mailing list
>erlang-questions@REDACTED
>http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140204/256adf2b/attachment.htm>


More information about the erlang-questions mailing list