Metaprogramming
From Erlang Community
(Difference between revisions)
| Revision as of 10:35, 22 September 2006 (edit) Vladdu (Talk | contribs) ← Previous diff |
Revision as of 10:42, 22 September 2006 (edit) (undo) Vladdu (Talk | contribs) Next diff → |
||
| Line 17: | Line 17: | ||
| <p> | <p> | ||
| - | Erlang has already support for | + | Erlang has already support for MP. It is composed from two parts: |
| + | *the parse trees for Erlang code are regular Erlang terms | ||
| + | *through the ''parse_transform'' concept, one can manipulate a module's parse tree before it is compiled | ||
| + | This is enough for quite advanced applications, but has the disadvantage that it's quite unwieldy and thus few have ventured into that area. Ulf Wiger has written code to make development of parse transforms easier. | ||
| + | </p> | ||
| + | <p> | ||
| </p> | </p> | ||
| Line 26: | Line 31: | ||
| ==Disclaimer== | ==Disclaimer== | ||
| - | Don't blame me if this stuff blows in your face :-) | + | Don't blame me if this stuff blows in your face or if your cat starts barking like a dog! :-) |
| [[Category:Concepts]] | [[Category:Concepts]] | ||
Revision as of 10:42, 22 September 2006
Contents |
Author
Vlad
Overview
Here I will gather some thoughts about metaprogramming in Erlang. Hopefully this will result in an implementation too (some parts have already been implemented). I put this here so that I can get input and the result will become a HowTo.
This is very much a work in progress. Please don't delete anything, just add your comments.
What is metaprogramming?
I won't go into the gory details here, there are plenty of papers on the matter. What I do mean by MP here is the capability of writing programs that handle programs.
Current status
Erlang has already support for MP. It is composed from two parts:
- the parse trees for Erlang code are regular Erlang terms
- through the parse_transform concept, one can manipulate a module's parse tree before it is compiled
License
The code associated with this HOWTO is available under the BSD License
Disclaimer
Don't blame me if this stuff blows in your face or if your cat starts barking like a dog! :-)

Digg It
Del.icio.us
Reddit
Facebook
Stumble Upon
Technorati

