On Mon, Jan 13, 2003 at 10:55:05AM +0100, Nicolas Chauvat wrote:
On Sun, Jan 12, 2003 at 02:32:54PM +1300, Andrew McGregor wrote:
Therefore a Pythonic macro should be:
A class which adds it's grammar
... Then the macro provides code which is called with the parse trees resulting from that grammar, modifies them, and returns the parse tree that will actually be compiled. If you want to evaluate some bits at compile time, do that explicitly in the macro (opposite way around to lisp, where you have complicated rules).
I want that!
Here is an interpreted language that does that : http://pliant.cx/
Fully GPL. Source available. Worth a look.
Note: I perfectly understand the goal of Minimal Python: do *not* change the language or parts of it (yet), just experiment with a minimal intepreter. That said, since Holger asked for desciptions of links here it goes: Both www.mozart-oz.org and pliant.cx (and others) are interesting for they rely on a minimal intepreter that lets one define part of the language itself (and basic ones like loop structure, for example). It can also be remarked that a good part of theoritically elegant languages (who said lisp?) rely on minimal interpreters. Having Python move forward in that direction may guarantee a nicer future for the language and should be easier to do thanks to the support of its large community. [back-to-lurking] -- Nicolas Chauvat http://www.logilab.com - "Mais où est donc Ornicar ?" - LOGILAB, Paris (France)