Getting Started

Get up and running with SUB in under five minutes. This guide covers installation, your first program, and the three tools in the toolchain.

Installation

The fastest way to install is the universal installer:

curl -fsSL https://raw.githubusercontent.com/subhobhai943/sub-lang/main/installer/install.sh | sh

Or grab a platform package from the download section.

Your first program

Create a file called hello.sb:

let name = "World"
println("Hello, " + name + "!")

Run with the interpreter

$ subi hello.sb
Hello, World!

Compile to native machine code

$ subc hello.sb -o hello
$ ./hello
Hello, World!

The resulting binary is a self-contained static ELF executable — no libc, no runtime dependencies.

Transpile to another language

$ sub hello.sb python    # → hello.py
$ sub hello.sb rust      # → hello.rs
$ sub hello.sb go        # → hello.go

The three tools

ToolPurpose
subiInterpreter + REPL. Runs .sb files directly. The reference every backend agrees with.
subcNative compiler. Emits x86-64 machine code and writes the ELF binary itself.
subTranspiler. Generates idiomatic code in 13 target languages.

The REPL

Run subi with no arguments to enter the interactive REPL:

$ subi
sub> let x = 42
sub> println(x * 2)
84
sub> :quit

Next steps