Get Started
This page serves as a guide for quickly getting up and running with Xen.
This page serves as a guide for quickly getting up and running with Xen.
Head over to the downloads page and download the appropriate distribution for your system. If your platform doesn't have any precompiled binaries, you'll need to build Xen from source.
Once you have Xen installed, make sure you add it's bin directory to your PATH environment variable.
In order to build Xen from source, you'll need to make sure your system meets the following requirements:
Once you've verified your system requirements, download the source code and extract the tarball. Then navigate into the project root and run the following command:
$ make debug # or release
For Windows compilation:
$ make windows-debug # or windows-release
Clean build artifacts:
$ make clean
Hello World in Xen is extremely simple. Create a new text file with the
extension
.xen
and add the following line to it:
include io; io.println("Hello World");
You can then run this program by running the following command:
$ xen hello-world.xen
Variables in Xen are defined with the
var keyword. Variable names can contain letters, numbers and the
underscore (_) and can have a maximum length of 64 characters. They
cannot begin with a number. Any valid Xen object can be assigned to a variable,
including functions.
var x = 10; # valid var _ = "hello"; # valid var my_var_80 = 0.1; # valid var 5_times = null; # invalid
Functions in Xen are defined with the
fn keyword. Function names follow all the same rules as variable
names.
fn inv_mod(a, b) { return -a % -b; }