Re: Python gets macros - now XML does too
From: Frank Buss (fb_at_frank-buss.de)
Date: 01/09/05
- Next message: Ray Dillinger: "Re: CLisp case sensitivity"
- Previous message: Ray Dillinger: "Scoping rules"
- In reply to: Manuel Lemos: "Re: Python gets macros - now XML does too"
- Next in thread: Manuel Lemos: "Re: Python gets macros - now XML does too"
- Reply: Manuel Lemos: "Re: Python gets macros - now XML does too"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 9 Jan 2005 00:57:28 +0000 (UTC)
Manuel Lemos <mlemos@acm.org> wrote:
> What is more interesting about the metaprogramming capabilities
> provided by MetaL is not metaprogramming features of level 0 (macro
> expansion) or even level 1 (generate code in other languages).
>
> The real power comes from level 2 metaprogramming features and
> eventually beyhond. Level 2 means that you write a code specification
> in an high level syntax. That that specification is translated into
> MetaL level 1/level 0 XML source code, which gets translated to the
> final target language of choice. Currently PHP, Java, and Perl are
> supported but it could be also LISP.
What you called level 2 metaprogramming is possible in Lisp, too. But as
far as I understand, you have to implement the expansion code in PHP for
your MetaL system. First a high-level description in XML, then
transforming it with a MetaL PHP module to a lower level XML description
and then transforming it again to Java or PHP with another MetaL PHP
module. This limits the things you can do or makes it too cumbersome. In
Lisp you use Lisp for transforming a macro to a lower level and the macro
code itself can use macros to help writing the macros easier, or you
could use the transformed macros for transforming other things (for
example you could implement the MetaL system with Lisp macros, which then
are used to translate XML to PHP, Lisp or Java).
Sometimes it might be necessary to use PHP or Java, for example if the
customer wants it, but your MetaL system shows, that PHP and Java are too
limited to use it without any external preprocessor, if you don't want to
write redundant code. This is ok, but in Lisp you write anything in Lisp;
you don't need to switch between different programming languages or
representations, and while writing your Lisp program, you enhance the
language itself to remove any redundant code.
-- Frank Buß, fb@frank-buss.de http://www.frank-buss.de, http://www.it4-systems.de
- Next message: Ray Dillinger: "Re: CLisp case sensitivity"
- Previous message: Ray Dillinger: "Scoping rules"
- In reply to: Manuel Lemos: "Re: Python gets macros - now XML does too"
- Next in thread: Manuel Lemos: "Re: Python gets macros - now XML does too"
- Reply: Manuel Lemos: "Re: Python gets macros - now XML does too"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|