Skip to main content
Installing the Hypotenuse Compiler means cloning the repository, building a self-contained binary with PyInstaller, and copying it to a location on your 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 asm blocks 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

1

Clone the repository

Run the following command to download the source code and enter the project directory.
git clone https://github.com/setuser1/The-Hypotenuse-Compiler
cd The-Hypotenuse-Compiler
2

Run the installer

Run make full-install to build the compiler binary and install it alongside the standard library.
make full-install
This command does the following:
  1. Installs PyInstaller and the other required Python build dependencies via pip.
  2. Bundles the compiler into a single self-contained binary named hypotenuse using PyInstaller.
  3. Copies the binary to /usr/local/bin/hypotenuse if you have write access, or to ~/.local/bin/hypotenuse otherwise.
  4. Creates the PLIBS/plstd directory (/usr/lib/PLIBS/plstd or ~/.local/lib/PLIBS/plstd) and copies the standard library into it.
3

Verify the installation

Confirm that the compiler is on your PATH and responding correctly.
hypotenuse --help
You should see the Hypotenuse Compiler help text listing all available flags. If the command is not found, see the PATH setup section below.

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, the plstd standard library, and a minimal Makefile. Two assets are attached to each weekly release:
  • hypotenuse-macos.zip — built on macos-latest. Use this on macOS (ARM64).
  • hypotenuse-x86_64.zip — built on ubuntu-latest. Use this on Linux x86_64.
Each archive contains:
  • hypotenuse — the bundled, self-contained compiler binary.
  • plstd/ — the standard library that the compiler loads from PLIBS/plstd.
  • makefile — a minimal Makefile with a single install target that copies the binary and the standard library into the correct system locations.
Weekly packages are tagged as pre-releases and are versioned by ISO year and week (for example, 26.23). They are built directly from the latest main and may be unstable. For production use, prefer building a tagged stable release from source.
1

Download the package

Open the Releases page, find the most recent weekly pre-release, and download the asset that matches your platform.
# macOS (ARM64)
unzip hypotenuse-macos.zip -d hypotenuse-weekly

# Linux (x86_64)
unzip hypotenuse-x86_64.zip -d hypotenuse-weekly
2

Run the bundled installer

The included Makefile installs the binary onto your PATH and the standard library under PLIBS/, using the same locations as make full-install.
cd hypotenuse-weekly
make install
This copies 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.
3

Install manually (optional)

If you prefer to place the files yourself, copy the binary to any directory on your PATH and the standard library into a PLIBS/ directory the compiler can find.
# Example: per-user install
mkdir -p ~/.local/bin ~/.local/lib/PLIBS
cp hypotenuse ~/.local/bin/hypotenuse
chmod +x ~/.local/bin/hypotenuse
cp -r plstd ~/.local/lib/PLIBS/
See PATH Setup if ~/.local/bin is not yet on your PATH.
4

Verify the installation

hypotenuse --help

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
make full-install-x86_64-elf
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.
NASM does not support generating ARM64 Mach-O object files, so asm blocks that use the arm64_macho syntax target must be compiled on a native ARM64 macOS host, not via this cross-compilation path.

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:
  1. Run the Hypotenuse Compiler without -c to emit the generated .c file instead of a linked binary. The .c output is portable standard C and can be fed to any C compiler.
  2. Build the resulting .c file with MSVC (cl.exe) — or any other Windows-capable C toolchain — yourself, linking against whatever runtime your code requires.
asm blocks and asm functions do not work on Windows at all. The NASM-driven assembly pipeline is not wired up for the MSVC path, so any source file containing asm will fail to produce a working binary on Windows. Strip or guard your asm code before building for Windows.

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.
export PATH="$HOME/.local/bin:$PATH"

Uninstall

To remove the hypotenuse binary from your system, run the uninstall target from inside the repository directory.
make uninstall
This removes the binary from whichever location it was installed to — /usr/local/bin/hypotenuse or ~/.local/bin/hypotenuse. It does not remove the PLIBS/ directory or its contents.