Skip to content

Installation

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.

IDEA Plugin

Set up IDEA Plugin for Yona, which provides syntax highlighting and syntax validation.

Running within local installation of GraalVM

Requirements

  • Any OS capable of running GraalVM
  • GraalVM 21.2.0 - Java 16
  • Ensure JAVA_HOME environment variable points to the root of your GraalVM installation
  • Ensure PATH contains your GraalVM root folder + /bin

Installation Instructions

It is possible to run Yona locally, whether for play purposes or development of new features.

Install GraalVM

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 GRAALVM_VERSION="21.3.0" GRAALVM_JAVA_VERSION="17"
wget -O $HOME/jdk.tar.gz https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-$GRAALVM_VERSION/graalvm-ce-java$GRAALVM_JAVA_VERSION-linux-amd64-$GRAALVM_VERSION.tar.gz
mkdir $JAVA_HOME && tar -xzf $HOME/jdk.tar.gz -C $JAVA_HOME --strip-components=1
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 yonanative currently 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.

Tip

There are many tests available in the Yona repository that can serve as a good starting point for writing some programs in Yona.

Interpreter logging

Logging can be enabled to debug certain types of issues, for example related to module loading. To do so, make sure your interpreter(either yona or yonanative) is ran with:

yona --log.yona.level=CONFIG

or additionally you can try increasing the log level all the way down to FINE, FINER or even FINEST.

Another option is to use -v / --verbose flag, which switches the log level to FINE.

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 $PATH.

Getting GraalVM

mvn package -DskipTests=true -Dmaven.javadoc.skip=true -B -V

Running Yona

After cloning the repository, Yona interpreter can be run simply by:

./yona <filename.yona>


Last update: August 25, 2021

Comments