XS

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.

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
fib(30) on the JIT
31 ms
fib(30) on the VM
180 ms
fib(30) on Node 20
62 ms
fib(30) on CPython 3.13
71 ms
binary size, stripped
2.9 MB
C source (excluding BearSSL)
132 KLOC

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.