Download
Tomato needs only clang (on a Mac: xcode-select --install; on Linux: your package manager, such as sudo apt install clang). It runs on macOS (Apple silicon and Intel) and on Linux (x86-64 and arm64, glibc 2.34 or later, planned for 1.0; other systems will build from the checked-in IR with one clang command); Windows is not a 1.0 target and there is no native Windows build, but the Run page works in any browser.
Latest release
Looking up the latest release…
macOS installer
Double-click the package and follow the steps. It installs to /usr/local/lib/tomato and links /usr/local/bin/tomato, with prebuilt compilers for Apple silicon and Intel, so nothing is built at install time. Programs are still compiled with clang, so you need the command line tools.
The package is signed and notarized by Apple, so macOS opens it on a plain double-click. The disk image is signed, notarized and stapled too; open it and double-click the package inside. You can also run sudo installer -pkg tomato-VERSION.pkg -target /. To check the download, compare shasum -a 256 tomato-VERSION.pkg with the SHA-256 above. tomato update works on a package install too. The installer hands /usr/local/lib/tomato to the user who installs it, so update needs no sudo; the flip side is that any process running as that user can change the command, which is the same trust as the ~/.tomato install. On a shared Mac, run sudo chown -R root /usr/local/lib/tomato and update with sudo instead. To uninstall: sudo rm -rf /usr/local/lib/tomato /usr/local/bin/tomato, then sudo pkgutil --forget com.davismcd.tomato.
Install from the tarball (Linux, or a Mac without the package)
tar -xzf tomato-VERSION.tar.gz
cd tomato-VERSION
clang -O1 -Wno-override-module -o tomato compiler/bootstrap/tomato.ll runtime/tomato_rt.c -pthread -lm # add -ldl on Linux; about a minute
./tomato install
tomato version
The one clang command builds the program from the checked-in IR, and the program installs itself. When a release carries a prebuilt program for your machine, it is in prebuilt/OS-ARCH/tomato (linux-x86_64, linux-aarch64, darwin-arm64 or darwin-x86_64), and prebuilt/linux-x86_64/tomato install installs it with no build; tomato update uses the prebuilt program when there is one and builds from the IR when there is not.
The install puts the program and its folders in ~/.tomato/native and links ~/.local/bin/tomato, after starting the new program to check that it works; the install it replaces is kept as ~/.tomato/previous. Put ~/.local/bin on your PATH; TOMATO_HOME and TOMATO_BIN choose other folders. An existing tomato that is not ours is kept as tomato.old. tomato doctor checks the C compiler, the linker and link-time optimization and says what to install if one is missing. The requests library and tomato update need the system libcurl (on Linux install it with your package manager). Then tomato run ~/.tomato/native/examples/compiled.tom 12 runs a sample program, and the guide shows the language.
Update
tomato update
Reads latest.json, checks the download against its SHA-256, and reinstalls when a newer version exists. A patch release only fixes things, so a newer one is installed at once. A new minor or major version (1.1.0 and later add features, and may remove standard-library names that an earlier release warned about) is not: tomato update says so and stops until you run tomato update --minor. Pre-releases such as 1.1.0-rc.1 are skipped unless you run tomato update --pre; an install that already runs a pre-release moves to a later pre-release or the final release without the flag. The new program is started before it replaces anything, and the install it replaces is kept: tomato update --rollback goes back to it. If the new program does not start at all, put the old one back by hand: mv ~/.tomato/native ~/.tomato/native.broken && mv ~/.tomato/previous ~/.tomato/native.
Trust
tomato update trusts HTTPS and the manifest: it reads the version, download URL and SHA-256 from one file, requires an official github.com/sirbuffalo/tomato/releases URL and a valid checksum, and only ever upgrades. Archives are not separately signed yet, so anyone who can change latest.json on the site or the main branch can change what gets installed.
From source
git clone https://github.com/sirbuffalo/tomato
cd tomato
clang -O1 -Wno-override-module -o tomato compiler/bootstrap/tomato.ll runtime/tomato_rt.c -pthread -lm # add -ldl on Linux
./tomato install
That one clang command is the whole bootstrap: it needs nothing else (no shell, no make, no other compiler), so any system with clang and a POSIX C library builds a working tomato this way, also one we have no prebuilt program for. Windows is not a 1.0 target. The checked-in compiler/bootstrap/tomato.ll is the program as it compiles itself; once you have a tomato, tomato build compiler/src/tomato.tom --entry main --jobs 8 -o tomato builds it from its source in parallel parts (compiler/bootstrap/README.md).