James Bond, Logo, and Trees

The latest “James Bond” release of minigrace (version 0.0.7.1010, thus James Bond) includes experimental support, written by Tim Jones, for generating Java code and calling Processing. Unfortunately this support really is very experimental, and will probably go away in the next release.

The main things we learned from the experiment is that while we can just about compile Grace to Java as a prototype, anything more serious either needs a global analysis to map Grace’s structural types to Java’s nominal types (a nice PhD thesis) or to generate byte codes and use invokedynamic to build Grace’s calling conventions (an MSc at least), or perhaps a mixture of the two.

Tim’s current plan – unless anyone volunteers to take over the Java side of things – is to concentrate on the JavaScript backend. Compiling to a dynamically typed substrate will be so much easier, and as a consequence, perhaps quicker too. Since Processing has a JavaScript implementation, if we can bind to that, we hope to be able to port Grace code calling the Processing API over to JavaScript without any change on the Grace side.

While playing with the experimental Java-backend I revisited some examples that was all the rage when I was starting out, fractal graphics done in Logo style. Stealing shamelessly from motivate.maths.org, all the images in this post were generated in Grace via the Processing API hosted on top of Java, running on a Mac OS 10.7.4. If you download the tarballs and install the files, you could play with something like this too – I mean, this is an example of Grace code that might actually be used, someday, to teach programming.



This article is translated to Serbo-Croatian language by Jovana Milutinovich from Webhostinggeeks.com.

Minigrace, a prototype compiler for Grace

Minigrace is a compiler for Grace, supporting most of the language specified so far and itself written in Grace. It compiles to native code via C and to JavaScript that runs in a web browser.

Minigrace is distributed as downloadable tarballs that require only a C compiler to build, or via git clone git://github.com/gracelang/minigrace.git. The git repository knows how to bootstrap itself by compiling the tarball. Documentation is included inside the source tree, including a description of unimplemented or additional features versus the specification. The test suite also provides an overview of implemented functionality.

The compiler should work on any POSIX-compatible system with GCC, and is known to work on Linux, NetBSD, and Mac OS X.  There is a client-side web front end suitable for quick experimentation and student programs that should work in any modern web browser with JavaScript enabled.

Once built, the most important Minigrace command line is:
./minigrace file.grace
which will compile and execute the given file. Other options are described in the documentation.

There is a Minigrace mailing list for discussing issues relating to the implementation. Release and update announcements will be sent to that list. Bug reports and suggestions can also be filed using the github issue tracker.

Pedagogical IDEs

A very important part of support for novices is a supportive interactive development environment (IDE), so we are planning on porting one or more of the existing pedagogical environments to support our language.  Not surprisingly, we are most interested in open-source, platform-independent IDEs that we can adapt to Grace

We are very familiar with (and have been investigating) BlueJ and DrRacket.  However, we thought it might be useful to check to see if there are others out there that people like that we should consider.  While I use Eclipse in my own intro classes at the moment, we are interested here in environments specifically designed to be supportive for novice programmers, so please don’t suggest IDE’s aimed at professional programmers.

Thanks in advance for your suggestions.