v0.1.0-demo.2 · Early development release
Xen language documentation
Xen is a programming language that compiles to static Linux executables. This documentation covers installation, language rules, the standard library, and command-line tools.
- Platforms
- Linux x86-64 · AArch64 (experimental)
- Status
- Syntax and APIs may change.
hello.xenXen
fn main() { println("Hello, Xen!");}COMMAND AND OUTPUT
$ xen run hello.xen
Hello, Xen!
Execution starts at fn main(). println writes a value followed by a newline.
Documentation
Learn
A sequential guide from installation and syntax to data types, generics, ownership, scope modes, iterators, and tests.
Reference
Syntax and type rules, scope modes, standard library APIs, CLI options, and supported features.
Versions
Documentation by release, with source commits and compiler downloads.
Examples
Complete source, commands, and expected output for 17 programs and two support modules.
Values and scope modes
Xen copies or moves values according to their type. Explicit references and block optimization are enabled in the scope that uses them.
| Feature | Behavior | Documentation |
|---|---|---|
| Passing values | Simple values copy; cloneable String/Vec values produce independent copies; Box/File values move. | Copy, move, borrow |
explc | Enable explicit references with #![explc] on a function or #scope[explc] on a block. | Scope modes |
opt | Apply optimization to #scope[opt] blocks. build/run/test default to --opt=basic. | CLI |