[Grace-core] Minigrace on Parrot

Michael Homer mwh at ecs.vuw.ac.nz
Thu May 5 19:27:51 PDT 2011


Hi,
I'm a PhD student working with James, and to start out I've been
building a small Grace-like language targeting the Parrot virtual
machine (<http://www.parrot.org/>). At this point it's fairly complete
as far as what I've aimed to include, so I'm putting it out for other
people to look at. I'm planning to use it to bootstrap
Minigrace-on-LLVM and then Grace-on-LLVM.

The language is based on the 0.096 specification, including many but
not all of the features described. It isn't a true subset of the full
language because it allows many programs that Grace would not, but the
aim was for there to be a dialect of Minigrace that was also a dialect
of Grace. It supports objects (but not classes), methods, vars,
strings, numbers (floats), and control structures as distinguished
syntactic forms.

The current implementation can be downloaded from
<http://homepages.ecs.vuw.ac.nz/~mwh/minigrace-20110506.tar.bz2>. It
should work with Parrot 3.0 and later. Build it with `parrot setup.pir
test`, or just run the packaged bytecode with `parrot minigrace.pbc`.
There is both an interactive REPL and the ability to run code from a
file.

The package includes five example files of test cases in t/*.t, and
the parser I wrote in Minigrace in parser.gc. The parser is the most
complex Minigrace code to date and runs right up against the
limitations of the language, but is capable of parsing itself slowly
and generating an abstract syntax tree. The test cases try to
demonstrate the supported features of the language, but aren't a
complete coverage.

The process of implementing the language and the parser and beginning
to look at the LLVM target brought up some questions about the
specification too, but I'll put them in a separate post.
-Michael


More information about the Grace-core mailing list