XS

v1.2.32

A programming language. Anywhere, anytime, by anyone.

One statically-linked binary contains the compiler, the language server, the debugger, the formatter, the linter, the test runner, the profiler, and the package manager. The same source runs unchanged on Linux, macOS, Windows, WASI, iOS, Android, ESP32, and Raspberry Pi.

6
backends
3
transpile targets
0
runtime deps
2.9
MB binary
hero.xs
macOS, Linux$curl -fsSL xslang.org/install | sh|
Windows>irm xslang.org/install.ps1 | iex
Source$git clone github.com/xs-lang0/xs && cd xs && make

Both installers verify the GitHub release against its published SHA-256 sums before running anything. Static binaries with checksums also live at /downloads.

Benchmarks

startup, hello world
3 ms
C source (excluding BearSSL)
132 KLOC
fib(30)
xs --jitxs (vm)node 20cpython 3.13
31 ms138 ms62 ms71 ms

Measured on a Linux x86-64 box, each binary cold from disk, best of three runs. Reproduce with bash tests/bench_backends.sh in the source tree. The JIT and VM numbers come from the same build that ships in releases.

Backends

xs --interp
tree-walk interpreter
for the REPL and AST-level plugin debugging
xs (default)
bytecode VM
what normal runs go through
xs --jit
register-allocating JIT
x86-64 + aarch64; opcodes outside its set fall back to the VM
xs --emit c
C transpiler
self-contained C source for any reasonable compiler
xs --emit js
JavaScript transpiler
Node or the browser; ships less than xs.wasm if you only need one program
xs.wasm
runtime build
the same compiler running in a browser; ships a virtual filesystem and behaves like the native binary, so any XS program can be evaluated at runtime. how to embed it.