🌱 A minimal programming language and compiler.
  • Go 90.4%
  • q 7.7%
  • HiveQL 1.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Eduard Urbach 264768c123
All checks were successful
/ test (push) Successful in 28s
Updated documentation
2026-08-24 11:58:54 +02:00
docs Updated documentation 2026-08-24 11:58:54 +02:00
examples Updated fnl example 2026-07-30 15:26:10 +02:00
lib Renamed internal asm package 2026-08-11 11:59:42 +02:00
src Removed dead code 2026-08-24 11:44:49 +02:00
tests Renamed internal asm package 2026-08-11 11:59:42 +02:00
.gitignore Updated documentation 2025-07-05 17:14:39 +02:00
go.mod Updated dependencies 2026-07-08 17:26:19 +02:00
go.sum Updated dependencies 2026-07-08 17:26:19 +02:00
main.go Initial commit 2025-06-18 22:18:31 +02:00

Q logo

The Q Programming Language

Features · Quickstart · Examples · Docs

A minimal, dependency-free language that compiles to tiny, fast machine code.

Features

  • 🚄 High performance (comparable to C and Go)
  • 🚀 Fast compilation (5-10x faster than most compilers)
  • 📦 Lightweight executables (1 KB for simple programs)
  • 🔍 Static analysis (integrated linter catches common mistakes)
  • 🛡️ Pointer safety (pointers cannot be nil)
  • ♻️ Resource safety (use-after-free is a compile error)
  • 🧠 Simple syntax (control flow is easily understood)
  • 💬 Friendly errors (clear and concise compiler messages)
  • 🌐 General purpose (apps, servers, games, kernels, etc.)
  • 🧩 Multiple architectures (x86-64 and arm64)
  • 🖥️ Multiple platforms (Linux, Mac and Windows)
  • 📖 Readable source (less than 1% of LLVM's code size)
  • 🧘 Zero dependencies (no external tools or libraries)

Quickstart

Warning

Q is in early development. Design and implementation are changing continuously.

Install

git clone https://git.urbach.dev/cli/q
cd q
go build
ln -s $PWD/q ~/.local/bin/

Run

q examples/hello

Build

q build examples/hello

Cross-compile with -os:

q build examples/hello -os windows

Inspect

q ssa examples/hello   # SSA form
q asm examples/hello   # Assembly output

Examples

hello

import io

main() {
	io.write("Hello\n")
}

echo

echo() {
	buffer := new(byte, 4096)

	loop {
		n, _ := io.read(buffer)

		if n == 0 {
			return
		}

		io.write(buffer[..n])
	}
}

fibonacci

fibonacci(n int) -> int {
	if n <= 1 {
		return n
	}

	return fibonacci(n - 1) + fibonacci(n - 2)
}

fizzbuzz

fizzbuzz(x int) {
	switch {
		x % 15 == 0 { io.write("FizzBuzz") }
		x % 5 == 0  { io.write("Buzz") }
		x % 3 == 0  { io.write("Fizz") }
		_           { io.write(x) }
	}
}

See more in the examples directory.

Docs

Community

Donate

License

See the license documentation.

© 2025 Eduard Urbach