A systems programming language that compiles to native code via LLVM. Fast, safe, and designed to feel less hostile than existing native languages.
Specification | Contributing | Editor Support | Devlog
-
Performance: Compiles to native machine code via LLVM. No runtime interpreter, no GC pauses. Suitable for games, AI infrastructure, embedded systems, and web services.
-
Safety: Ownership-based memory model with no use-after-free, no double-free, and no data races — without lifetime annotations. Ownership is persistent, borrowing is ephemeral, long-lived relationships use handles.
-
Ergonomics: Indentation-based scoping, type inference, f-string interpolation, first-class regex,
let ... elsefor early returns,withblocks for scoped mutation, and seamless C interop viac_import. The common case should not require ceremony.
print("Hello, World!")
var nr = 0
for line in file.read_lines("server.log"):
nr += 1
if line =~ /error (\d+)/:
print(f"{nr}: {line}")
fn handle(req: Request) -> Response:
let user = db.find_user(req.params.id) else:
return Response.not_found()
Response.json(user)
let config = with Config.default() as mut c:
c.timeout = 30
c.retries = 3
Install the latest Darwin arm64 binary:
curl -fsSL https://github.com/withlang-dev/with/releases/latest/download/install.sh | shInspect the installer before running it:
curl -fsSL https://github.com/withlang-dev/with/releases/latest/download/install.sh | lessThe installer writes with to ~/.local/bin by default. Set
WITH_INSTALL_DIR to choose another directory.
Make sure the install directory is on your PATH, then run:
with run examples/hello.wAll release binaries are listed on the releases page.
Requirements:
- LLVM toolchain (default
/usr/local/llvm, override withLLVM_PREFIX) - clang on PATH
The compiler is self-hosting. The build chain is seed -> stage1 -> stage2:
git clone https://github.com/withlang-dev/with.git
cd with
with build :seed # download seed compiler (if `with` is not on PATH)
with build # build the compiler
with build :test # run test suiteInstall to your PATH:
with build :install-user # installs to ~/.local/bin/withRelease publishing uses the checklist in docs/with-release-runbook.md.
The compiler compiles itself. with build :fixpoint builds stage3 from stage2
and verifies they are byte-identical. If fixpoint breaks, the compiler has a
nondeterminism bug.
with build :fixpointThe compiler includes a built-in language server (with lsp) with diagnostics,
go-to-definition, hover, and format-on-save. Setup instructions for VSCode,
Neovim, Vim, Emacs, Zed, and Helix are in docs/editor-support.md.
See CONTRIBUTING.md for build setup, architecture overview, testing, and debugging instructions.
With is distributed under the MIT License.