Iron is a general-purpose native programming language for command-line tools, network services, data processing, simulations, and games. Compile to C, manage memory explicitly, and put concurrency to work.
func main() { val samples = [10, 20, 30, 40, 50] var total: Int = 0 for sample in samples { total += sample } println("processed={len(samples)} total={total}") }
Native compilation, explicit resource management, and readable code — useful across application domains.
Iron compiles through C to native binaries with the Iron runtime linked in. There is no Iron VM or tracing garbage collector. Static interface dispatch keeps implementation choices visible to the compiler.
You manage memory explicitly — stack, heap, reference counting — with compiler-assisted safety nets. No borrow checker, no hidden magic.
Thread pools, parallel loops, and concurrency primitives are first-class language features, not library afterthoughts.
No operator overloading, no implicit conversions, no hidden control flow. When you read Iron code, you know exactly what it does.
Start small, explore the libraries, and help shape an evolving language.
Write command-line utilities and data-processing programs with native compilation and explicit resource lifetimes.
Explore HTTP/HTTPS, WebSocket, TCP, UDP, and file I/O with explicit deadlines and cleanup.
Express numerical work and concurrent tasks with typed values, native code, and first-class concurrency.
Use Raylib for visualization, interactive applications, and games. Graphics are one part of Iron's broader toolkit.
Iron gives you fine-grained control without boilerplate.
Choose the right strategy for each allocation. Stack by default, heap when you need it, reference counting for shared ownership. Use free or defer free for heap-owned values, and opt into reference counting for shared ownership. Compiler diagnostics and checked pointers help catch lifetime mistakes.
free / defer free — explicit lifetime managementrc for shared ownershipdefer for deterministic resource cleanupleak for intentional permanent allocationsobject Record { val id: Int } func main() { val local = Record(1) val owned = heap Record(2) defer free owned val shared = rc Record(3) val also = shared println("local={local.id} owned={owned.id} shared={also.id}") }
Named thread pools, typed channels, mutexes, and parallel loops are built into the language. No external threading libraries, no callback pyramids.
parallel loops with automatic work distributionfunc sum_to(n: Int) -> Int { var total = 0 for i in range(n) { total += i } return total } func main() { val task = spawn("summary") { return sum_to(100) } val total = await task println("total={total}") }
Move supported computations out of the runtime path. Use comptime to evaluate constants and pure expressions when compiling, and keep configuration values close to the code that uses them.
comptimeval BUFFER_BYTES = comptime (64 * 1024) func main() { println("buffer bytes={BUFFER_BYTES}") }
First-class stdlib for HTTP/HTTPS, WebSocket/WSS, TCP, UDP, DNS, typed IP addresses, and RFC 3986 URLs. Errors are concrete values, never exceptions. Timeouts are deadlines the runtime actually honours, from DNS through TLS and message decoding.
import net -- resolve a hostname with a 2s budget val (addrs, err) = Net.lookup_host("example.com", 2000) if err.code != 0 { return } -- dial + write, tuples everywhere val (sock, derr) = Net.tcp_dial("example.com", 80, 2000) if derr.code != 0 { return } defer TcpSocket.close(sock) TcpSocket.write(sock, "GET / HTTP/1.0\r\n\r\n", 1000) -- pure-Iron RFC 3986 URL handling val (u, _) = Url.parse("https://example.com/path?q=iron") println(u.host) -- "example.com" println(u.query) -- "q=iron"
Install Iron with a single command, then run your first program. macOS and Linux supported.