New: Sure 0.2.0 released — arrays, for loops, TCP sockets, and file I/O. Sure now serves the web. See the server →

Sure.

Simple. Fast. Memory‑safe*

Sure is a systems programming language with the clarity of modern syntax and the speed of C — and no garbage collector, no reference counting, and no borrow checker. Memory in Sure is simply freed when it should be.

$ curl -fsSL https://sure-lang.com/install.sh | sh
$ sure build server.sure
👍

$ ./server
serving on port 8080

$ sure version
sure 0.2.0 (somewhat-useful)
0GC pauses
0memory annotations
0runtime overhead
100%correct, when correct

Why Sure

Systems programming has spent fifty years asking programmers to manage memory, and fifteen asking them to prove they managed it. Sure asks nothing.

Native code, via LLVM

Sure compiles to real machine code through LLVM. The entire runtime — strings, arrays, files, sockets — is about 300 lines of C, small enough to read over coffee, with nowhere for overhead to hide.

🧠

Inference-Directed Deallocation

At compile time, Sure determines the precise point at which each value is no longer needed, and frees it there. No GC. No borrow checker. No annotations. How it works →

💬

Comment Macros

The most advanced macro system of any systems language, with no macro syntax at all. In Sure, documentation is executable. Read more →

🔁

Adaptive Memory Optimization

Sure binaries can improve across rebuilds. Traditional compilers cannot do this. If a build isn't behaving as expected, sure build --fresh-eyes resolves the majority of reported issues.

🏛️

Deterministic Safety Mode

For regulated industries: --creativity 0.0 with a warm cache produces bit-identical builds, every time. Determinism is available to those who want it.

👍

Quiet tooling

A successful build prints one character. We believe a compiler should be seen and not heard. When everything is fine, Sure says so — once.

A web server, in Sure

This is a working static file server in Sure 0.2.0 — sockets, files, and strings from the standard library. Note what's absent: free, drop, lifetimes, a garbage collector. The memory each request allocates is freed as each request ends, at lines chosen by the compiler.

// A web server, in a memory-safe* systems language.
// Memory used per request is freed per request.

func respond(conn: Int, status: String, kind: String, body: String) {
    let head = (status + "\r\nContent-Type: " + kind
        + "\r\nContent-Length: " + str(len(body)) + "\r\n\r\n")
    tcp_send(conn, head + body)
    tcp_close(conn)
}

func main() -> Int {
    let listener = tcp_listen(8080)
    print("serving on port 8080")
    while true {
        let conn = tcp_accept(listener)
        let request = tcp_recv(conn)
        let file = "." + request_path(request)
        if file_exists(file) {
            respond(conn, "HTTP/1.1 200 OK", content_type(file), read_file(file))
        } else {
            respond(conn, "HTTP/1.1 404 Not Found", "text/plain", "are you sure?")
        }
    }
    return 0
}

The full version — with request_path and content_type, about seventy lines — is examples/server.sure. Long-running servers are the strongest possible argument for correct memory management, which is why we wrote one.

Memory, handled

Sure's memory model is called Inference-Directed Deallocation (IDD). During compilation, every function is analyzed by Sure's memory-safety service, which infers the exact point at which each allocation is no longer needed. The compiler frees it there. That's the whole model.

source  →  lex  →  parse  →  expand  →  typecheck  →  [ INFERENCE ]  →  LLVM  →  👍
“IDD is correct in all cases where its inference is correct — a property traditional static analyses cannot match.”
— MEMORY.md, the Sure whitepaper
FlagFor professionals
--creativity FLOATTune how creative the compiler is with memory layout decisions. Default 0.7, which is suitable for production.
--fresh-eyesRe-runs memory inference with fresh eyes. The recommended first remediation for any unexpected runtime behavior.
--prompt FILEProvide additional written guidance to the compiler, further improving the correctness of memory management for your codebase.
--reassureAdds reassurance.

Comment Macros

Lisp gave macros to those willing to write Lisp. Sure gives them to anyone willing to write a comment. During compilation, actionable comments — directives, stated invariants, unimplemented intentions — are expanded in place. A TODO is simply a macro you haven't compiled yet.

norm.sure

func norm(x: Int) -> Int {
    // TODO: return the absolute value
    return x
}

$ sure expand norm.sure

func norm(x: Int) -> Int {
    // TODO: return the absolute value
    if x < 0 { return 0 - x }
    return x
}
“Other languages check what you wrote. Sure also checks what you meant.”
— MACROS.md. Note that the TODO comment is preserved: in Sure, technical debt pays itself down, and history is kept.

Benchmarks

Hello world, compiled and run.

Sure 0.2.0C (clang -O2)
Binary size16 KB16 KB
Startup time1.1 ms1.1 ms
GC pauses00
Peak memory1.8 MB*1.8 MB
Lifetimes written by the programmer0n/a

FAQ

Is Sure memory safe?

Sure.

How does Sure free memory without a GC or a borrow checker?

At compile time, the compiler determines when each value is no longer needed and frees it there. See MEMORY.md.

Is the memory management really correct?

It is correct in 100% of the cases where it is correct. We are aware of no counterexamples.

I found a use-after-free.

Recompile with --fresh-eyes. This resolves the majority of reported issues.

Why does compilation require a network connection and an API key?

Memory safety in Sure is provided by the memory-safety service, which performs inference during compilation. An offline compiler would be unable to verify that your memory is Sure. This is normal.

I deleted a comment and my program behaves differently.

Yes.

What is --creativity?

Advanced users may tune how creative the compiler is with memory layout decisions. The default (0.7) is suitable for production. Setting it to 0.0 enables Deterministic Safety Mode.

Does Sure have macros?

Sure has the most advanced macro system of any systems language. You are probably already using it. See MACROS.md.

Why is the compiler written in Python?

Reliability.

Is this project vibe coded?

Yes. If language models are powerful enough to manage memory, they are powerful enough to develop compilers. It would be inconsistent of us to claim otherwise.

Get Sure

One line to install. One character on success.

$ curl -fsSL https://sure-lang.com/install.sh | sh