MATHEMATICS

Minggu, 20 November 2011

Compiler development 2/2

OK, what is the status It's in the technical design phase. Graphica is a 3D scene graph language, ( the first version of ) the Graphica compiler generates Mathematica source code that will be handled by Mathematica ( another target to compile to could be Java/jReality for example ). I am at the point of studying the theory behind compilers and the selection of tools, candidates I have pre-selected are:
- ANTLR,
- javaCC,
- jparsec and
- an all handcrafted option.
More options may pop-up while studying though. I selected four books to study:
- (1) Modern compiler implementation in Java, A.Appel, CUP 2004
- (2) Programming Language Processors in Java, D.Watt, D.Brown, Prentice Hall 2000
- (3) ANT LR Reference, Terence Parr, Pragmatic Bookshelf 2007
- (4) Compilers, PT&T, Aho, et al, Pearson 2007
Title (4) is aka the Dragon book and supposedly is the best book on the subject, I'll use that as a glossary. Title (1) supports a javaCC approach, and develops MiniJava, a subset of Java, (2) builds a compiler and interpreter for a language called Triangle ( with Java ). I already downloaded the source, created a project for it in NetBeans and tested a few compiles and runs of a Triangle program which is a Pascal type of language. Several bugs have been reported over the years which I have collected and should fix. Title (3) is clearly pro ANTLR. And (4) is the authoritative reference. Some of the books may seem old but I used a list from a 2010 university syllabus.

I'll have to solve one other issue on the Mathematica side of the project, and that is how to remotely create a Notebook using a kernel I am connected to in Java. Once that is solved I can continue programming, using a stub compiler if necessary.

The purpose of Graphica is to stimulate my personal development and knowledge of computer science, so any pro-s and con-s that I might mention are clearly mine and have to be seen in that light only.

To be continued

Tidak ada komentar:

Posting Komentar