Get the oxl toolchain
Requires: a C compiler (cc) and pthreads; oxl build/run emit C and
link through it. Programs that use the sqlite3 shims also need sqlite3 dev
headers. The release tarball ships for Linux (x86_64); macOS (aarch64) and
Windows (x86_64, via MinGW gcc or LLVM clang) are supported platforms that
build from source. See the
README.
-
Download and extract the latest toolchain release:
Terminal window curl -LO https://github.com/oxidean/oxl/releases/latest/download/oxl-toolchain-linux-x86_64.tar.gztar xzf oxl-toolchain-linux-x86_64.tar.gz && cd oxl-toolchain -
The tarball bundles the compiler,
std/, andexamples/. Try the bundled hello world:Terminal window ./oxl run examples/hello.oxl # compile + run (needs cc on PATH) -
Put the toolchain on
PATH, then write and run your own program. Keepstd/next to theoxlbinary: that is whereimport "std/x"resolves. Every file starts with apackageclause, andpackage mainmarks an executable:hello.oxl package mainfn main() {println("hello, oxl")}Terminal window export PATH="$PWD:$PATH"oxl run hello.oxl # compile + runoxl build hello.oxl # → native binary
oxl build and oxl run invoke a C compiler for the final link. The
driver probes cc → gcc → clang (MSVC’s cl can’t take the emitted
C). Set LANG_CC to override, LANG_LDFLAGS to append link inputs (FFI
shim objects, libraries), and LANG_SQLITE_SRC to point at an
amalgamation sqlite3.c where no dev package exists.
Building from source
Section titled “Building from source”On macOS, Windows, or any platform without a tarball, build the toolchain
from the repository (a Rust toolchain plus cc):
git clone https://github.com/oxidean/oxl && cd oxl# resolve the latest published release tag via /releases/latest (curl# only, no auth); skip the checkout to build `main` instead:TAG=$(curl -sL -o /dev/null -w '%{url_effective}' \ https://github.com/oxidean/oxl/releases/latest | xargs basename)git checkout "$TAG" && cargo build --release --manifest-path oxl/Cargo.toml# binary: oxl/target/release/oxl; put it on PATH with std/ alongsideimport "std/x" resolves against std/ next to the binary, so run it
from the repo root or copy std/ next to wherever the binary lands.
The toolbox
Section titled “The toolbox”oxl build [<pkg dir>|<file.oxl>...] [-o out] compile to a native binaryoxl run [<pkg dir>|<file.oxl>...] compile + runoxl test [<pkg dir>|<file.oxl>...] run all fn test_*() in a scope eachoxl fmt <file.oxl>... canonical AST pretty-print (comments kept)oxl doc <file.oxl> /// comments → markdownoxl get <path>@<query> fetch + pin a dependency (needs git)oxl mod <init|tidy|verify|list> maintain oxl.mod / oxl.sumoxl list -m all the MVS-selected module build listoxl lsp stdio LSP: diagnostics, hover, goto-definitionoxl get, oxl mod, and oxl list -m are the package/module system:
projects opt in with an oxl.mod manifest at the root. The
language page covers manifests, resolution, and
the module cache.