code is data

Anton Vredegoor anton.vredegoor at gmail.com
Fri Jun 23 07:54:30 EDT 2006


Paul Boddie wrote:

> Anton Vredegoor wrote:

>> Yes, but also what some other posters mentioned, making Pythons internal
>> parsing tree available to other programs (and to Python itself) by using
>> a widely used standard like XML as its datatype.
> 
> http://pysch.sourceforge.net/ast.html

Very interesting, it led me to some sxml describing pages and it also 
tricked me into reading some Python documentation that I had always 
considered to be hiding some arcane deep Python magic. I guess now that 
Python is officially entering tree territory (as opposed to providing 
third party functionality) it seems unavoidable that Python's officially 
endorsed tree datatype will also be used for some of its internal 
structures, thereby making it more accessible to programmers like me and 
to outside programmers.

> I was going to write a long reply to one of your previous messages, but
> the above link references a project which may intersect with some of
> your expectations. Meanwhile, it should be noted that the availability

Somehow I get the impression of getting away with my posts luckily, 
while you now are duping other interested readers into not reading your 
innermost feelings about this subject. Let's get it in the open, don't 
spare me :-)

> of Python AST processing tools is not a recent thing: the compiler
> module has been around for a long time, and it is possible to modify
> the AST and to generate bytecode from it; my own experiments have
> centred on producing other representations from the AST, and other more
> successful projects (eg. ShedSkin) produce other languages (eg. C++)
> from the AST.

Well maybe this trick of vehemently denying the existence of something 
on Usenet worked again, by materializing the thing as a reaction.

However, I knew of the existence of such languages but I am mostly 
interested in standardized code interchange, like for example with JSONP 
which fetches some external javascriptcode from another server using 
JSON and places the translated javascript into a webpage at the request 
of the clients browser or so it seems. Maybe a Python webserver could 
also emit pieces of javascript code by getting them from a *Python* code 
library after translating Python code on the fly?

That would open up the web to Python programmers without browsers 
needing to understand Python. Like Jython, but now as separately 
distributed functions from different servers.

Anton



More information about the Python-list mailing list