Why Niao?
Niao is a modern programming language and full development ecosystem—compiler, bytecode VM, package manager, standard libraries, web framework, and machine-learning stack—implemented in Rust. It was designed around a simple philosophy: write it once, run it fast, with a minimal memory footprint.
Key Architecture Features
- Fast by default: Programs compile down to lightweight bytecode and run on a custom stack VM. It features a mark-compact garbage collector (GC) and
.niaobcbytecode caching to bypass compilation overhead on subsequent runs. - Familiar Syntax: Clean C/Rust-style functions, static type annotations, classes, and traits—along with a block DSL for web servers.
- Gradual Static Typing: Annotate types when you want safety and structure, or skip them when you want rapid prototyping.
- Single Toolchain: The
niaocommand manages running and building programs, whilenmacts as the registry installer to install and manage libraries.
Hello, Niao!
Writing code in Niao feels intuitive if you have used TypeScript, Rust, or Python:
fn greet(name: string) -> string {
return "Hello, " + name
}
fn main() {
print(greet("Niao"))
}
You can run it instantly using the command-line tool:
niao run hello.niao
Stay tuned as we continue building Niao in public! Check out the Roadmap to see active development progress.
