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 interpreterfor the REPL and AST-level plugin debugging
- xs (default)
- bytecode VMwhat normal runs go through
- xs --jit
- register-allocating JITx86-64 + aarch64; opcodes outside its set fall back to the VM
- xs --emit c
- C transpilerself-contained C source for any reasonable compiler
- xs --emit js
- JavaScript transpilerNode or the browser; ships less than xs.wasm if you only need one program
- xs.wasm
- runtime buildthe 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.