Introduction
Kiwi is a dynamically typed scripting language with a small, readable syntax and a large standard library. Blocks are delimited with end instead of braces or indentation, strings interpolate with ${...}, and everything from HTTP to SQLite to CSV ships in the box.
fn greet(name = "world") println "Hello, ${name}!"end
greet() # Hello, world!greet("Kiwi") # Hello, Kiwi!The interpreter is written in C# (.NET 10). Scripts are compiled to bytecode and run on a stack-based virtual machine, and the standard library is itself mostly written in Kiwi.
What Kiwi is good at
Section titled “What Kiwi is good at”- Scripts and command-line tools. Argument parsing, colored output, tables, prompts and progress bars are in the
clipackage; shell commands are one call away insys. - Working with data. Read and write CSV, JSON, YAML and XML, query SQLite, and reshape rows with
table. - Small services. An HTTP server with routing and middleware, an HTTP client, TCP/TLS and UDP sockets, and background tasks with channels.
- Learning and prototyping. A REPL with multi-line editing and a step debugger.
A first program
Section titled “A first program”Save this as hello.kiwi:
println "Hello, World!"Run it:
kiwi hello.kiwiThere is no main function to declare and nothing to import. Top-level statements run from top to bottom, and the whole standard library is available by default.
How these docs are organized
Section titled “How these docs are organized”- Getting Started gets Kiwi installed and walks through the language in one sitting with the tour.
- Language covers each part of the language in depth: syntax, types, functions, structs, packages, errors and so on.
- Tools documents the
kiwicommand, the REPL, the debugger and the test framework. - Reference lists every keyword, every built-in method by type, and the global functions.
- Standard Library has a page per package. The API section of each page is generated from the docstrings in
lib/*.kiwi, so it always matches the source.
Every Kiwi example in these docs is run against the interpreter in CI, so what you read is what Kiwi does.