PATH. The installer also sets up the PLIBS/ directory that the compiler searches when you import from <plstd> or any other library. Before you start, make sure your system has the tools listed below.
Prerequisites
You need the following software installed before running the installer.- Python 3.14 or later — the compiler itself is written in Python, and PyInstaller bundles it during the build step.
- Linux (x86_64) or macOS (ARM64) — the two host platforms that build and install automatically. Windows (x86_64) is supported as a manual target — see Windows Support below.
- GCC — used to compile the C output that the Hypotenuse Compiler generates and to link the final binary.
- NASM — used to assemble any
asmblocks in your C△ source files.
On most Linux distributions you can install GCC and NASM with your package manager — for example,
sudo apt install gcc nasm on Debian/Ubuntu or sudo dnf install gcc nasm on Fedora. On macOS, install Xcode Command Line Tools (xcode-select --install) for GCC, and NASM via Homebrew (brew install nasm).Install from Source
Clone the repository
Run the following command to download the source code and enter the project directory.
Run the installer
Run This command does the following:
make full-install to build the compiler binary and install it alongside the standard library.- Installs PyInstaller and the other required Python build dependencies via pip.
- Bundles the compiler into a single self-contained binary named
hypotenuseusing PyInstaller. - Copies the binary to
/usr/local/bin/hypotenuseif you have write access, or to~/.local/bin/hypotenuseotherwise. - Creates the
PLIBS/plstddirectory (/usr/lib/PLIBS/plstdor~/.local/lib/PLIBS/plstd) and copies the standard library into it.
Install from a prebuilt weekly release
If you do not want to build from source, you can download a prebuilt package from the project’s GitHub Releases page. A GitHub Actions workflow publishes a new pre-release every Friday containing the compiler binary, theplstd standard library, and a minimal Makefile.
Two assets are attached to each weekly release:
hypotenuse-macos.zip— built onmacos-latest. Use this on macOS (ARM64).hypotenuse-x86_64.zip— built onubuntu-latest. Use this on Linux x86_64.
hypotenuse— the bundled, self-contained compiler binary.plstd/— the standard library that the compiler loads fromPLIBS/plstd.makefile— a minimal Makefile with a singleinstalltarget that copies the binary and the standard library into the correct system locations.
Download the package
Open the Releases page, find the most recent weekly pre-release, and download the asset that matches your platform.
Run the bundled installer
The included Makefile installs the binary onto your This copies
PATH and the standard library under PLIBS/, using the same locations as make full-install.hypotenuse to /usr/local/bin/hypotenuse and plstd/ to /usr/lib/PLIBS/plstd when you have write access to /usr/local/bin, or to ~/.local/bin/hypotenuse and ~/.local/lib/PLIBS/plstd otherwise.Install manually (optional)
If you prefer to place the files yourself, copy the binary to any directory on your See PATH Setup if
PATH and the standard library into a PLIBS/ directory the compiler can find.~/.local/bin is not yet on your PATH.Cross-compile for Linux x86_64 on ARM64
If you are on an ARM64 Mac and need to produce a Linux x86_64 ELF compiler binary, use the Docker-based cross-compilation targets. Docker must be installed and running before you begin.make build-x86_64-elf spins up a linux/amd64 Docker container, installs PyInstaller inside it, and builds an ELF binary named hypotenuse-x86_64-elf in the dist/ folder. make full-install-x86_64-elf then installs that binary to the same locations described above, renaming it to hypotenuse.
Windows Support
Windows (x86_64) is a technically supported target, but the Hypotenuse Compiler cannot drive the full build for you the way it does on Linux and macOS. The compiler does not invoke MSVC, and no GCC/NASM-equivalent automation ships for the MSVC toolchain. To build a C△ program on Windows you must do it in two steps:- Run the Hypotenuse Compiler without
-cto emit the generated.cfile instead of a linked binary. The.coutput is portable standard C and can be fed to any C compiler. - Build the resulting
.cfile with MSVC (cl.exe) — or any other Windows-capable C toolchain — yourself, linking against whatever runtime your code requires.
PATH Setup
If the installer places the binary in
~/.local/bin/hypotenuse, you need to add ~/.local/bin to your PATH. Add the following line to your shell configuration file (~/.bashrc, ~/.zshrc, or equivalent) and reload your shell.Uninstall
To remove thehypotenuse binary from your system, run the uninstall target from inside the repository directory.
/usr/local/bin/hypotenuse or ~/.local/bin/hypotenuse. It does not remove the PLIBS/ directory or its contents.