P T Withington
ptw at pobox.com
Wed Dec 2 11:15:43 PST 2009
On 2009-12-02, at 13:57, Rami Ojares / AMG Oy wrote:
> What is the compiler currently doing?
> My quess is something like this.
> 2) Then this is combined with the core laszlo files and the combination is some sort of version of ecma edition 4.
> 3) Using some compiler compiler like antlr or similar AST is created.
> 4) And using various techniques (mostly manual hacks :) from this AST the source/bytecode file(s) are generated for the chosen runtime.
> Was this quess in the right direction?
So, basically, our "js2" acts as the intermediate language for the XML compiler, allowing the back-ends that target js-like platforms to be relatively simple variations on a theme.
This is a pretty standard compiler path, using pretty standard compiler techniques. Except since we are not compiling down to a hardware, we don't feel compelled to use an RTL for our intermediate language.
> What is the compiler compiler you are using?
JavaCC. I have no idea if that is a good or bad choice. It was at the time the project started.
The compiler was originally written mostly in Jython, which was great for the initial project. Some time in the deep-dark past, I re-wrote the whole thing (rather painfully) into Java, to try to speed it up. It could surely do with another rewrite...
More information about the Laszlo-dev