AML is a small DSL written on top of GraalVM and its Truffle framework. Read the Specification for information about its features.
The language is structured in four modules:
- language: contains the language implementation and tests.
- polyglot: exemplifies how to use the DSL with Java.
- repl: a small REPL to try out the DSL.
- runner: provides an executable to run a AML file.
The only required dependency is GraalVM version 21.0.0 which can be downloaded from the official GraalVM website. After downloading it and pointing the JAVA_HOME
environment variable to it you are ready to go.
To build the project, a maven wrapper is available for both windows and unix systems. The following command compiles all code, executes the tests and builds all necessary JAR files:
# On windows use mwnw.cmd instead of mwnw
$ ./mwnw package
To actually use AML there are different possibilities:
- Using a REPL: the
repl
script provides the ability for both windows and unix to start a REPL and try out AML. - Evaluating a source file: the
runner
script expects a file path as input and executes the file. Look at thesamples
of the repository for some example files. - Embedding the DSL: to use the DSL as an embedded language through GraalVM a component has to be created first and installed using the Graal Updater tool. The
make_component.sh
,install_component.sh
andremove_component.sh
script show how this can be achieved. Furthermore thepolyglot
module,polyglot.rb
andpolyglot.clj
show how AML can be embedded using different languages.