[ | smalltalk dot org ].
Community and industry meet inventing the future.
Abstract Syntax Trees Rule!
written by Peter William Lount
Version 1, 20040624

I must agree with Colin Putney regarding: Essential Code Implemented and Essential Code. Thanks for your post, The next coding revolution?, James.

I've taken this Abstract Syntax/Parse Tree approach in the Zoku variant of Smalltalk. Amoung the many advantages is there are no byte codes. Byte code loose information that the compiler could use to produce better optimized native code. There are also many other advantages.

I learned about this approach to representing programs and the advantages of no byte codes from a paper about Oberon a many years back.

The authors of "A Tree-Based Alternative to Java Byte-Codes" (PDF) claim that: "... performance penalties are not a necessary consequence of machine-independence, but related to Java s particular intermediate representation. We have constructed a prototype and are further developing a software transportability scheme founded on a tree-based alternative to Java byte-codes. This tree-based intermediate representation is not only twice as compact as Java byte-codes, but also contains more detailed semantic information, some of which is critical for advanced code optimizations. Our architecture not only provides on-the-fly code generation from this intermediate representation, but also continuous re-optimization of the existing code-base by a low-priority background process. The re-optimization process is guided by up-to-the-minute profiling data, leading to superior optimization results."

They go on to conclude: "... we have shown, that portability and high performance need not necessarily be irreconcilable. We have proposed an alternative intermediate representation that is based on abstract syntax trees rather than on low-level byte-codes. This intermediate representation, bundled with a dynamic runtime optimizer and an adaptive profiler, builds the basis for advanced and aggressive optimizations that are difficult to perform on a lower-level representation much of essential information is lost in the transition from source code to byte-codes. We have shown that our current version of the proposed architecture can compete with today s fastest just-in-time compilers, although no optimizations have yet been implemented."

It's about degrees of freedom, not just in the language syntax, but also in the design and implementation of the virtual machines and object libraries as well. Every degree of freedom has a potental gain. It might also have a cost, that at first might seem like it can't be overcome, however innovation and creative thinking can usually turn up a solution that others haven't thought of yet. Or if they have you can often find a paper about it! ;--)
Copyright 1999-2010 by Smalltalk.org"!, All Rights Reserved.