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; 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
./install-native.sh
tomato version

This builds the compiler from the checked-in IR into ~/.tomato/native and links ~/.local/bin/tomato. 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. The requests library needs the system libcurl (on Linux install it with your package manager), tomato repl needs bash, and tomato update needs curl. Then tomato run ~/.tomato/native/examples/compiled.tom main 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.

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
./install-native.sh