Metacode mechanics
David Medlock
noone at nowhere.com
Tue Feb 28 05:22:16 PST 2006
Georg Wrede wrote:
<snip>
> So I suggest that we:
>
> - continue developing the current D metalanguage
> - continue to have both Don's and Phobos' regexps
> - in this NG start the development of requirements for KBDM
>
> KBDM being Kick-Butt D Metalanguage. :-)
This is a very good idea, as code-which-generates-code is the heart of
some powerful techniques(Lisp/Scheme macros among them).
To make them truly work however one of the following is really needed:
1. Runtime evaluation, as in scripting type languages. In this case all
you need is a function which returns a string.
2. A _uniform_ way to represent all the constructs of the language.
This works in Lisp because everything is a List(actually a CONS cell),
and you can simply walk the tree checking for symbols and generating
code as needed.
D is much simpler than C++, I will agree wholeheartedly. However, I fear
that such a language strapped on to D would be rife with kludges to
accomodate its (relatively)complex syntax.
Cheers.
-DavidM
More information about the Digitalmars-d-dtl
mailing list