You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: The Moth project is under active development.
Moth is a new interpreter offering high performance for long-running Grace programs. Moth is built on top of SOMns v0.6 and while it achieves great peak-performance we still have some way to go before realizing a complaint Grace implementation.
Contents
To get started have a look at Getting Ready for dependencies and then the Install section for information about building the project (or just run ant from the root directory of Moth). From there we show how you can invoke tests, benchmarks, and your own programs in Running Grace.
Status
The latest release is reflected by the master branch .
Although we are working toward a compliant implementation, Moth doesn't yet implement all of Grace's features. Despite these drawbacks, peak performance is comparable to V8 for the AWFY benchmarks; more information can be found in our preprint.
Getting Ready
Moth consists of three repositories:
SOMns - our fork that adapts SOMns to provide Grace support,
GraceLibrary - a collection of Grace programs, tests, and benchmarks designed to be used in Moth.
To successfully build Kernan, you will need to have the xbuild installed on your machine. The best way to obtain this is to downloaded the latest release of the mono (an umbrella project focuses on bringing better cross-platform tooling and support to Microsoft products).
To successfully build SOMns, you will need to have Apache's ANT command line tool (easily installed through most package managers) and a version of Java that implements the compiler interface. We are currently using version 10.0.1.
Install
This one is simple, just run our build script by invoking ant from Moth's root directory. You will first see information about Kernan being built and then SOMns (the Grace library does not need to be compiled). Once everything has been built successfully, you should see something like the following output in your command line:
Provided both Kernan and Moth compiled as expected, you can now run Grace programs using the moth executable:
./moth GraceLibrary/hello.grace
Note that the moth executable will first set the MOTH_HOME environment variable to Moth's root directory and then start Kernan in the background before running Moth. When Moth is finished, the executable will conclude by terminating Kernan.
Running Grace
Running a Grace program is simple; you invoke the moth executable from the command line, along with the path to your program as the argument. For example, executing ./moth GraceLibrary/hello.grace runs the hello world program.
We maintain a small test suite, which can be executed via the Test Runner using ./moth -tc GraceLibrary/Tests/testRunner.grace (the -tc argument turns on dynamic type-checking, which is required for some of the tests to pass).
Finally, you may also run Moth in benchmarking mode. To do this, execute the harness along with a Grace benchmark and the iteration numbers you want to use. For example, executing: