Running as a Docker container:¶
The simplest way to use Yona is to run it in a Docker container. Please see the instructions at Docker Hub.
Set up IDEA Plugin for Yona, which provides syntax highlighting and syntax validation.
Running within local installation of GraalVM¶
- Any OS capable of running GraalVM
- GraalVM 20.2.0
JAVA_HOMEenvironment variable points to the root of your GraalVM installation
PATHcontains your GraalVM root folder +
It is possible to run Yona locally, whether for play purposes or development of new features.
These instructions set up GraalVM, required environment variables and install the Yona component into GraalVM.
export JAVA_HOME=$HOME/jdk PATH=$JAVA_HOME/bin:$JAVA_HOME/graalvm/bin:$PATH wget -O $HOME/jdk.tar.gz https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.2.0/graalvm-ce-java11-linux-amd64-20.2.0.tar.gz mkdir $JAVA_HOME && tar -xzf $HOME/jdk.tar.gz -C $JAVA_HOME --strip-components=1 gu install native-image gu install -ur https://github.com/yona-lang/yona/releases/latest/download/yona-component.jar
You can see Yona releases at GitHub releases page.
Run yona interpreter¶
Yona comes as a GraalVM component, with two executables:
yona- default interpreter, supporting all GraalVM features, such as Polyglot usage, etc.
- (unsupported at the moment)
yonanative- ahead-of-time compiled interpreter that offers faster startup, though may be slower executing longer running programs. Note that
yonanativecurrently works only on 64-bit Linux.
Both executables currently accept only a filename as an argument. This file is then executed using the interpreter. Optionally, if no file is provided, the interpreter will expect an input on the standard input when ran. Ctrl-D marks the end of the input in this case.
There are many tests available in the Yona repository that can serve as a good starting point for writing some programs in Yona.
Logging can be enabled to debug certain types of issues, for example related to module loading. To do so, make sure your interpreter(either
yonanative) is ran with:
or additionally you can try increasing the log level all the way down to
FINER or even
Local development setup¶
These instructions are for setting up a local development environment. Currently Debian 10 is the only verified platform (though, any Linux that runs GraalVM should in theory work).
Build requirements - Debian¶
sudo apt install build-essential zlib1g zlib1g-dev
Download and install Maven¶
Download Maven from their site. Then unpack it somewhere and make sure maven/bin path is added to
mvn package -DskipTests=true -Dmaven.javadoc.skip=true -B -V
After cloning the repository, Yona interpreter can be run simply by: