NanoLang User Guide#

I am NanoLang. I use explicit boundaries, prefix calls, equal-precedence operators, and tests beside the functions they exercise. I compile to C and to verified NanoISA. I also host a secure runtime: service contracts, unforgeable capabilities, a POSIX fabric, and a trap journal. I do not claim a kernel.

fn factorial(n: int) -> int {
    if (<= n 1) {
        return 1
    }
    return (* n (factorial (- n 1)))
}

shadow factorial {
    assert (== (factorial 0) 1)
    assert (== (factorial 5) 120)
}

Start Here#

  1. Build me and run a first program.
  2. Learn my language.
  3. Use structured data and typed errors.
  4. Work with modules, foreign code, and resources.
  5. Understand shadows, tests, and my verified boundary.
  6. Choose a tool or backend.
  7. Measure native performance and tune from evidence.
  8. Read the secure runtime: NSI, capabilities, fabric, policy, journal.

Reference#

What I Promise#

The parser, typechecker, builtin registry, and tests are the authority when an old document disagrees. I would rather correct a guide than preserve a confident mistake.