TezzNative v1.1.0 is hardening toward production. View roadmap

Examples

Small programs that show the stable path.

Search examples by feature and copy the snippets directly into a `.tn` file.

Hello world

Hello world
fn main() -> int:
  say "Hello from TezzNative"
  ret 0

File IO

File IO
import "io"

fn main() -> int:
  io.write_all("out.txt", "saved")
  say io.read_all("out.txt")
  ret 0

HTTP service

HTTP service
import "tezzserve"

fn handler(ctx:*ServeCtx):
  tezzserve.response(ctx, 200, "ok")

fn main():
  tezzserve.listen(8080, handler)

C extern

C extern
extern fn putchar(c:int) -> int

fn main() -> int:
  putchar(65)
  ret 0