Install writeonce

Two native binaries — woc, the compiler, and wovm, the runtime VM. Both depend only on the system C library. There is no package manager to install, no language runtime to install on the machines you deploy to, and no build toolchain beyond these two files.

Supported systems

Check yours with ldd --version. If it is older than 2.35, build from source until a wider-compatibility release exists. The floor is set by the machine that BUILT the release, not by the language — the CI runner is pinned to Ubuntu 22.04 to keep it this low.

1. Download

One tarball, two binaries. Take it from the GitHub release, or from this site as a mirror — they are the same bytes, and the checksum below proves it:

Download 0.1.0 (linux-amd64) Mirror

Verify it before you extract it. The expected digest is served beside the archive at .sha256:

curl -O https://writeonce.de/dl/writeonce-0.1.0-linux-amd64.tar.gz
curl -O https://writeonce.de/dl/writeonce-0.1.0-linux-amd64.tar.gz.sha256
sha256sum -c writeonce-0.1.0-linux-amd64.tar.gz.sha256

2. Extract it

Extract into /usr/local, replacing any previous install. Run this as root, or through sudo:

rm -rf /usr/local/writeonce
tar -C /usr/local -xzf writeonce-0.1.0-linux-amd64.tar.gz

3. Put it on your PATH

Add one line to your $HOME/.profile (or /etc/profile for every user on the box), then restart your shell:

export PATH=$PATH:/usr/local/writeonce/bin

4. Check it

Both should print the same version. woc finds wovm beside itself, so a tarball install needs no further configuration.

woc version        # writeonce 0.1.0 linux/amd64
wovm --version     # wovm 0.1.0

5. Your first project

A project is a directory with a wo.toml manifest and one or more .wo files. Nothing else — no lockfile to create by hand, no scaffolding step.

mkdir hello && cd hello

cat > wo.toml <<'EOF'
name    = "hello"
version = "0.1.0"

[runtime]
wo = ">= 0.1"
EOF

cat > main.wo <<'EOF'
fn main() -> Int {
  print("hello, writeonce");
  return 0;
}
EOF

6. Build and run

woc <dir> emits ONE standalone binary at target/<name>. Copy that file to a server and run it — the VM is inside it, and so is the database.

woc .
./target/hello        # hello, writeonce

7. Add a dependency

Dependencies are git repositories pinned by revision. The [deps] KEY is the module name your code uses. woc writes a wo.lock with the exact revision, and a locked build works offline. See Packages for what is available.

[deps]
view = { git = "https://github.com/shoneyj/writeonce-view", rev = "v0.1.0" }

Where things go

The tarball installs to /usr/local/writeonce: bin/woc, bin/wovm, and a VERSION file. To point woc at a different VM, set $WO_RUNTIME or add a [build] runtime = "..." key to wo.toml. A manifest may also require a minimum toolchain with [runtime] wo = ">= 0.1"; woc refuses to build a project that needs a newer toolchain than itself.