SimCity, Robot Odyssey, and Visual Programming

From: Don Hopkins
Subject: Education?

Of course it might just be more powerful and efficient to re-implement something like Klik-and-Play from scratch in Python, as a plug-in visual scripting component, which can be used to script a HyperCard-like gui environment, and games built on top of it like SimCity and Robot Odyssey.

From: Antoine van Gelder
Subject: Education?

Anyone know the current status of being able to turn an AST tree emitted by the Python compiler module back into code after it has been modified ?

From: Andrew Clunis
Subject: Education?

I've been looking into this for Develop activity, but it seems that path has never been explored. Best approach seems to be to write a pretty-printer to walk the tree.

From: Guido van Rossum
Subject: Education?

I'm curious about the focus on ASTs that seems apparent in this subthread (though I may easily be misreading between the lines :-). I've always been more inclined to edit the text and re-parse from there, as it puts the author in control of formatting, comments etc., and this is how most "real-world" environments work. (Not that that necessarily makes it better, but neither is the opposite true.) Is someone willing to write up a brief comparison between the two approaches?

Tiny compilers for Python AST

I have a TAG, Transformational Attribute Grammar, compiler, which compiles itself in C. You start with a BNF grammar and decorate it with the variables going up and down the language structure. Each rule of the grammar becomes a subroutine. Fairly serious languages can be handled in less than ten pages of simple code. .................... This is work done by Tom Pittman after he got his doctorate at UCSC and wrote, "ART OF COMPILER DESIGN". It's open source and freely available. If you know what you want to generate, it should be easy to do it, though the compiler will be fairly slow to run. Perhaps it would make compiling the abstract syntax tree of Python into something else pretty easily..................... I have long thought but never tested that it could be used to translate a language into itself with extra explanatory commentary or profiling or debugging code. ................ Richard Karpinski, World class nitpicker...... Dick@CFCL.com ...... Put Nitpicker in subject line to get past filters........ (Formatting info seems unavailable.)