Skip to content

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.

  • Scripts and command-line tools. Argument parsing, colored output, tables, prompts and progress bars are in the cli package; shell commands are one call away in sys.
  • 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.

Save this as hello.kiwi:

println "Hello, World!"

Run it:

Terminal window
kiwi hello.kiwi

There 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.

  • 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 kiwi command, 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.