Linux
Verified on x86_64. Building from the WebAssembly seed needs only a C compiler and CMake.
Requirements
Debian, Ubuntu
sudo apt install git cmake build-essentialFedora
sudo dnf install git cmake gcc makeArch
sudo pacman -S git cmake base-develBuild the compiler
git clone https://github.com/sultan-language/sultanc.git cd sultanc ./build.sh --bootstrap=wasmInstall it on your
PATH, with Supaxcd .. git clone https://github.com/sultan-language/supax.git cd supax tools/install.sh ../sultancPuts
sultanc, its standard library and Supax in~/.supaxand adds it to yourPATH. Open a new terminal afterwards.Check
sultanc --version
macOS
Verified on Apple Silicon (arm64). Building from the WebAssembly seed needs only a C compiler and CMake.
Requirements
The Xcode command-line tools, and CMake (here from Homebrew):
xcode-select --installbrew install cmakeBuild the compiler
git clone https://github.com/sultan-language/sultanc.git cd sultanc ./build.sh --bootstrap=wasmInstall it on your
PATH, with Supaxcd .. git clone https://github.com/sultan-language/supax.git cd supax tools/install.sh ../sultancPuts
sultanc, its standard library and Supax in~/.supaxand adds it to yourPATH. Open a new terminal afterwards.Check
sultanc --version
Windows
Windows has no Native backend yet, so the build there goes through LLVM.
Requirements
A C compiler, CMake 3.21 or newer, a shell that runs
build.sh, and an LLVM 19 to 23 SDK withLLVM-C.libandLLVM-C.dll. If the build does not find it, point at it withSULTANC_LLVM_ROOT.Build the compiler
git clone https://github.com/sultan-language/sultanc.git cd sultanc ./build.sh --bootstrap=c --enable-llvm --backend=llvmInstall it on your
PATH, with Supaxcd .. git clone https://github.com/sultan-language/supax.git cd supax powershell -ExecutionPolicy Bypass -File tools\install.ps1Check
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.
Build the compiler (Linux)
git clone https://github.com/sultan-language/sultanc.git cd sultanc ./build.sh --bootstrap=wasmCompile 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 sultancaarch64-freebsd
./build/sultanc --target=aarch64-freebsd \ --module-source=compiler.backend.provider.llvm.llvm_codegen=compiler/backend/provider/llvm/unavailable.sn \ compiler/main.sn -o sultancCheck
Copy
sultancto the device and run it from a directory that holdscompiler/andlibrary/(or setSULTANC_STD). It compiles for its own system by default, and compiles itself too.sultanc runis 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.
Build the compiler (Linux)
git clone https://github.com/sultan-language/sultanc.git cd sultanc ./build.sh --bootstrap=wasmCompile 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 sultancx86_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 sultancCheck
Copy
sultancto the device and run it from a directory that holdscompiler/andlibrary/(or setSULTANC_STD). It compiles for its own system by default, and compiles itself too.sultanc runis 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=wasm | WebAssembly seed: only a C compiler and CMake |
--bootstrap=c | C seed (the default): a C compiler, CMake and LLVM 19 to 23 |
--bootstrap=existing | An 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.