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.
-
Install the toolchain and put it on
PATH(see Install for releases and the version manager):Terminal window curl -fsSL https://raw.githubusercontent.com/oxidean/oxl/main/scripts/install.sh | shexport PATH="$HOME/.oxl/bin:$PATH" -
Try the bundled hello world — installed toolchains carry
std/andexamples/under${OXL_HOME:-~/.oxl}/versions/<tag>/oxl-toolchain/. Ask the shim which tag is actually resolved — it may differ fromdefault-versionwhenOXL_TOOLCHAIN, a.oxl-versionfile, or atoolchaindirective inoxl.modselects another — then run the example out of that one toolchain:Terminal window if cur=$(oxl toolchain current); thentag=${cur%% *}oxl run "${OXL_HOME:-$HOME/.oxl}/versions/$tag/oxl-toolchain/examples/hello.oxl"fi -
Write and run your own program.
import "std/x"resolves againststd/next to the binary. Every file starts with apackageclause, andpackage mainmarks an executable:hello.oxl package mainfn main() {println("hello, oxl")}Terminal window 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 C compiler plus pthreads):
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 | sed 's|.*/releases/tag/||')git checkout "$TAG" && bash scripts/stage0.sh# binary: target/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.