Re: Python gets macros - now XML does too

From: Manuel Lemos (mlemos_at_acm.org)
Date: 01/04/05


Date: Tue, 04 Jan 2005 20:27:25 -0200

Hello,

on 12/19/2004 11:45 PM Brian Downing said the following:
>>>These are a far cry from your translations into PHP and Java. I would
>>>have to say that the MetaL spec is not declarative enough. It pretty well
>>>specifies a contrived way (i.e. Java and PHP coding conventions) to
>>>implement the algorithm.
>>I am not sure what is your point.
>
> from your web site:
>
> MetaL is shorthand for Meta-programming Language.
> Meta-programming is a method to develop computer programs. It
> works by generating source code in a target language from a
> program specification in a higher level language.
>
> I think his point is that you have specified a rather Java/PHP-specific
> solution in your MetaL code for that example. There's no way you could
> go from your MetaL specification to Wade's code above, even though they
> do the same thing.

I see, but it seems you are viewing it from the wrong perspective. Let
me explain.

The point of MetaL is that from the same MetaL source code it can
generate equivalent code in different target languages, just like a C
compiler that can generate assembly code for different CPUs.

> If you had written your MetaL spec for this problem with higher-level
> abstractions, it is conceivable that your program specification could
> generate the rather idiomatic Lisp code above and simultaneously be able
> to output the lower-level Java and PHP code in your example. Instead
> you've encoded the lower-level stuff into your specification, which
> limits generating higher level code without a rather taxing analysis
> process.
>
> (It's possible that this example was simply rushed and not a typical
> sample of MetaL code.)

The MetaL compiler engine is modular. This means that I can add as many
modules as I want. There is no closed spec for the language because I
can add, remove, exchange any modules as it pleases me or whover feels
compeled to hack it.

That sample code that you have seen is just an example that uses
whatever modules were necessary to create a class for creating XML
documents (at runtime).

Currently there are about 30 modules but many more could be used for
implementing higher or lower level language constructs. It is just a
matter of need.

-- 
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html


Relevant Pages

  • Re: Breaking backwards compatibility - good or bad?
    ... coming and are needed to anything really big and useful in PHP. ... command or statement in the language that is going to be made invalid ... The PHP team tries very hard not to break CORRECT scripts. ... "Introducing case-sensitivity for variables and functions names has ...
    (comp.lang.php)
  • Re: Case sensitivity in programming languages.
    ... the language. ... And these conventions take advantage of case sensitivity. ... In PHP it can be any of those things. ... group of programmers who want t force their stupid ideas onto others. ...
    (comp.lang.php)
  • Re: A Lot of Questions from a Noob
    ... OOP is a language paradigm that is not specific to ... I Google'd for an introduction to object-oriented programming, ... Watch out for the die-hard Perl fanbois: ... PHP 5 OOP has come a long way from PHP 4. ...
    (comp.lang.php)
  • Re: Case sensitivity in programming languages.
    ... Is any language issued with a set of function names in different ... You get a warning if you reference an undeclared variable in PHP if your ... In something like PHP we could generate a convention ... The ability to have 3 different functions called readfile(), ...
    (comp.lang.php)
  • Re: Websites 101
    ... Some things have changed in PHP already thoug. ... but people who understand very little about programming ... The more similar a language is to an other, ... PHP borrows a lot from Perl, ...
    (alt.internet.search-engines)