SultanC
  1. Home

Install SultanC

SultanC is installed by building it from source. Pick your system.

Linux

Verified on x86_64. Building from the WebAssembly seed needs only a C compiler and CMake.

  1. Requirements

    Debian, Ubuntu

    sudo apt install git cmake build-essential

    Fedora

    sudo dnf install git cmake gcc make

    Arch

    sudo pacman -S git cmake base-devel
  2. Build the compiler

    git clone https://github.com/sultan-language/sultanc.git cd sultanc ./build.sh --bootstrap=wasm
  3. Install it on your PATH, with Supax

    cd .. git clone https://github.com/sultan-language/supax.git cd supax tools/install.sh ../sultanc

    Puts sultanc, its standard library and Supax in ~/.supax and adds it to your PATH. Open a new terminal afterwards.

  4. Check

    sultanc --version

macOS

Verified on Apple Silicon (arm64). Building from the WebAssembly seed needs only a C compiler and CMake.

  1. Requirements

    The Xcode command-line tools, and CMake (here from Homebrew):

    xcode-select --install
    brew install cmake
  2. Build the compiler

    git clone https://github.com/sultan-language/sultanc.git cd sultanc ./build.sh --bootstrap=wasm
  3. Install it on your PATH, with Supax

    cd .. git clone https://github.com/sultan-language/supax.git cd supax tools/install.sh ../sultanc

    Puts sultanc, its standard library and Supax in ~/.supax and adds it to your PATH. Open a new terminal afterwards.

  4. Check

    sultanc --version

Windows

Windows has no Native backend yet, so the build there goes through LLVM.

  1. Requirements

    A C compiler, CMake 3.21 or newer, a shell that runs build.sh, and an LLVM 19 to 23 SDK with LLVM-C.lib and LLVM-C.dll. If the build does not find it, point at it with SULTANC_LLVM_ROOT.

  2. Build the compiler

    git clone https://github.com/sultan-language/sultanc.git cd sultanc ./build.sh --bootstrap=c --enable-llvm --backend=llvm
  3. Install it on your PATH, with Supax

    cd .. git clone https://github.com/sultan-language/supax.git cd supax powershell -ExecutionPolicy Bypass -File tools\install.ps1
  4. Check

    sultanc --version

FreeBSD

The compiler is not built on the device itself: build it on Linux (x86_64) first, then compile a compiler for this system from there.

  1. Build the compiler (Linux)

    git clone https://github.com/sultan-language/sultanc.git cd sultanc ./build.sh --bootstrap=wasm
  2. Compile a compiler for this system

    x86_64-freebsd

    ./build/sultanc --target=x86_64-freebsd \ --module-source=compiler.backend.provider.llvm.llvm_codegen=compiler/backend/provider/llvm/unavailable.sn \ compiler/main.sn -o sultanc

    aarch64-freebsd

    ./build/sultanc --target=aarch64-freebsd \ --module-source=compiler.backend.provider.llvm.llvm_codegen=compiler/backend/provider/llvm/unavailable.sn \ compiler/main.sn -o sultanc
  3. Check

    Copy sultanc to the device and run it from a directory that holds compiler/ and library/ (or set SULTANC_STD). It compiles for its own system by default, and compiles itself too. sultanc run is not available there: compile the program and run the executable.

Android

The compiler is not built on the device itself: build it on Linux (x86_64) first, then compile a compiler for this system from there.

  1. Build the compiler (Linux)

    git clone https://github.com/sultan-language/sultanc.git cd sultanc ./build.sh --bootstrap=wasm
  2. Compile a compiler for this system

    aarch64-android

    ./build/sultanc --target=aarch64-android \ --module-source=compiler.backend.provider.llvm.llvm_codegen=compiler/backend/provider/llvm/unavailable.sn \ compiler/main.sn -o sultanc

    x86_64-android

    ./build/sultanc --target=x86_64-android \ --module-source=compiler.backend.provider.llvm.llvm_codegen=compiler/backend/provider/llvm/unavailable.sn \ compiler/main.sn -o sultanc
  3. Check

    Copy sultanc to the device and run it from a directory that holds compiler/ and library/ (or set SULTANC_STD). It compiles for its own system by default, and compiles itself too. sultanc run is not available there: compile the program and run the executable.

Build routes

A build starts from a small seed, then the compiler builds itself in stages. Choose the seed with --bootstrap:

--bootstrap=wasmWebAssembly seed: only a C compiler and CMake
--bootstrap=cC seed (the default): a C compiler, CMake and LLVM 19 to 23
--bootstrap=existingAn already built compiler: one step, about a minute. For development

Add --enable-llvm to include the LLVM backend in the compiler. The build finds LLVM by itself in its usual locations, Homebrew included, or name one with LLVM_CONFIG=/path/to/llvm-config.

Next: the getting-started guide, or the language tour.