SimpleLanguage Documentation
repository·master·Indexed 20 days ago
https://github.com/graalvm/simplelanguageA demonstration language implemented using the Truffle framework for GraalVM. It serves as a reference implementation and educational tool for developers learning how to build new languages, providing instructions for building and running the language on a standard JVM or as a Native Image using Maven.
What's inside SimpleLanguage
- SimpleLanguage is a demonstration language built using the Truffle framework for GraalVM. It is designed to serve as an educational resource for understanding how to implement a language using Truffle. The source code is heavily documented to explain the implementation details of a Truffle language.
Build and run SimpleLanguage as a Native Image
masterTo build a standalone native executable using GraalVM's native-image capabilities, use the
-PnativeMaven profile. After the build completes, the native executable can be found in thestandalone/target/directory and run directly via./standalone/target/slnative.mvn package -Pnative ./standalone/target/slnativeBuild a SimpleLanguage Native Image
masterTo build a native image of SimpleLanguage in addition to the JVM version, run the Maven package command with the
nativeprofile enabled using the-Pnativeflag.mvn package -PnativeRun the SimpleLanguage standalone build
masterAfter building, you can execute the language using the generated binaries in the
targetdirectory. Usetarget/slfor the JVM version ortarget/slnativeif you performed a native build.# For JVM build target/sl # For Native build target/slnativeBuild and run SimpleLanguage on a JVM
masterTo build the project for use on a standard JVM, use Maven to package the application. Once built, you can run the language using the
./slscript, which utilizes the JDK specified in yourJAVA_HOMEenvironment variable.mvn package ./slBuild the SimpleLanguage JVM standalone version
masterTo build a JVM-based standalone version of SimpleLanguage that utilizes the JDK specified by your
JAVA_HOMEenvironment variable, use the standard Maven package command.mvn package