# Plumlang > Plumlang is a small, fast, memory-safe programming language with easy syntax, static types, tasks and a built-in HTTP server, shipped as one binary. An Elixpo production. Plumlang source files end in `.plum`. `plum check FILE` reports every error without running anything; `plum run FILE` runs a program; `plum stdlib MODULE` lists a module's functions. Keywords keep a garden theme: `plant` (variable), `root` (constant), `branch` (function), `tree` (class), `seed` (import), `drop` (print), `good` / `bad` (true / false). Plumlang is new: read the documentation instead of guessing its syntax from other languages. Every docs page is also available as Markdown at its URL plus `index.md`. ## Start - [Install Plumlang](https://plum.elixpo.com/docs/install/index.md): Install Plumlang with one command, curl | sh on Linux and macOS or irm | iex on Windows, or build plum from source with a C11 compiler and make. - [Plumlang reference](https://plum.elixpo.com/docs/reference/index.md): The whole language on one page, for people who know another language and for coding agents. The specification is the full contract; this page is checked by… - [Using Plumlang with coding agents](https://plum.elixpo.com/docs/agents/index.md): Give a coding agent Plumlang's documentation, with llms.txt, llms-full.txt and a Markdown copy of every docs page, plus an AGENTS.md snippet for your project. ## Tour - [A tour of Plumlang](https://plum.elixpo.com/docs/tour/index.md): A step-by-step introduction to Plumlang for beginners, from printing a line to a web server, with a small runnable program on every page. - [Hello, world](https://plum.elixpo.com/docs/tour/hello-world/index.md): Your first Plumlang program. Print text with drop, write comments with #, and run a program with plum run or check it with plum check. - [Values and variables](https://plum.elixpo.com/docs/tour/values/index.md): Plumlang's basic types (int, float, str, bool), variables with plant, constants with root, type inference, conversions and string interpolation. - [Making decisions and loops](https://plum.elixpo.com/docs/tour/control-flow/index.md): Control flow in Plumlang. if and else, if as a value, match on values and ranges, while loops, for loops over ranges and lists, break and continue. - [Functions](https://plum.elixpo.com/docs/tour/functions/index.md): Declaring functions in Plumlang with branch, parameter and result types, one-line functions with =>, default and named arguments, lambdas and closures. - [Lists, maps and missing values](https://plum.elixpo.com/docs/tour/collections/index.md): Plumlang collections (lists, maps and sets), how values are copied, optional types with none, the ?? operator and if plant to unwrap. - [Trees: your own types](https://plum.elixpo.com/docs/tour/trees/index.md): Defining your own types in Plumlang with tree. Fields with defaults, methods and self, to_str for printing, init, inheritance with super, and shared objects. - [Traits and kinds](https://plum.elixpo.com/docs/tour/traits-and-kinds/index.md): Plumlang traits (interfaces with default methods) and kinds (enumerations whose cases can carry values), with match covering every case. - [When things go wrong](https://plum.elixpo.com/docs/tour/errors/index.md): How Plumlang reports mistakes. Compile errors with codes and hints, runtime errors with stack traces, and throw, try, catch and finally for your own errors. - [Modules](https://plum.elixpo.com/docs/tour/modules/index.md): Importing standard library modules with seed, aliases and named imports, splitting a Plumlang program into files, private names, and packages with plum.toml. - [Tasks](https://plum.elixpo.com/docs/tour/tasks/index.md): Concurrency in Plumlang. spawn runs a function as a task, wait collects its result, and channels pass values between tasks, with no async or await and no data races. - [A web server](https://plum.elixpo.com/docs/tour/web-server/index.md): Build an HTTP server in Plumlang with net.http. Routes with parameters, query strings and JSON responses, plus the HTTP client, each connection in its own task. ## Language specification - [Language reference](https://plum.elixpo.com/docs/language/index.md): The Plumlang language specification, section by section: source text, types, expressions, statements, functions, trees, modules, errors, memory and tasks. - [Design principles](https://plum.elixpo.com/docs/language/design-principles/index.md): Design principles, section 1 of the Plumlang language specification. A first program: - [Source text](https://plum.elixpo.com/docs/language/source-text/index.md): Source text, section 2 of the Plumlang language specification. A Plumlang source file is UTF-8 text with the extension .plum. A byte order mark at the start… - [Types](https://plum.elixpo.com/docs/language/types/index.md): Types, section 3 of the Plumlang language specification. Plumlang is statically typed: every expression has a type known before the program runs, and type… - [Variables and expressions](https://plum.elixpo.com/docs/language/variables-and-expressions/index.md): Variables and expressions, section 4 of the Plumlang language specification. plant declares a variable, root a constant. A declaration always has a value. - [Statements](https://plum.elixpo.com/docs/language/statements/index.md): Statements, section 5 of the Plumlang language specification. A block is a sequence of statements in { }. The opening brace goes on the same line as the… - [Functions](https://plum.elixpo.com/docs/language/functions/index.md): Functions, section 6 of the Plumlang language specification. Parameter types are always written. The result type is written after -> and left out for… - [Built-in functions](https://plum.elixpo.com/docs/language/built-in-functions/index.md): Built-in functions, section 7 of the Plumlang language specification. These are always available without seed: - [Trees: classes and objects](https://plum.elixpo.com/docs/language/trees-classes-and-objects/index.md): Trees: classes and objects, section 8 of the Plumlang language specification. A tree groups fields and the methods that work on them: - [Modules](https://plum.elixpo.com/docs/language/modules/index.md): Modules, section 9 of the Plumlang language specification. Every .plum file is a module. Its top-level statements run once, in order, the first time it is… - [Errors](https://plum.elixpo.com/docs/language/errors/index.md): Errors, section 10 of the Plumlang language specification. Compile errors (wrong types, unknown names, syntax) stop the program before it starts, with the… - [Values and memory](https://plum.elixpo.com/docs/language/values-and-memory/index.md): Values and memory, section 11 of the Plumlang language specification. Numbers, booleans, none, strings, lists, maps, sets and kinds are values: assigning or… - [Tasks and concurrency](https://plum.elixpo.com/docs/language/tasks-and-concurrency/index.md): Tasks and concurrency, section 12 of the Plumlang language specification. spawn runs a function call as a task, a lightweight thread of work. The program… - [The standard library](https://plum.elixpo.com/docs/language/the-standard-library/index.md): The standard library, section 13 of the Plumlang language specification. Modules are imported with seed. The 1.0 library is planned as: - [Running programs](https://plum.elixpo.com/docs/language/running-programs/index.md): Running programs, section 14 of the Plumlang language specification. Exit codes: 0 success, 1 the program failed (compile or runtime error, or exit(1)), 2… - [Changes from the Python prototype](https://plum.elixpo.com/docs/language/changes-from-the-python-prototype/index.md): Changes from the Python prototype, section 15 of the Plumlang language specification. The Python prototype (plum-lang v0.1 to v0.10) introduced the garden… - [Open questions](https://plum.elixpo.com/docs/language/open-questions/index.md): Open questions, section 16 of the Plumlang language specification. To be settled before the parser (#10) depends on them: ## Standard library - [The standard library](https://plum.elixpo.com/docs/stdlib/index.md): Plumlang's standard library: math, strings, io, os, time, files, JSON, tasks and channels, TCP and UDP networking, and an HTTP server and client. - [math](https://plum.elixpo.com/docs/stdlib/math/index.md): The Plumlang math module: constants and functions on numbers, and random numbers. Angles are in radians. Functions that take a float also take an int. - [str](https://plum.elixpo.com/docs/stdlib/str/index.md): The Plumlang str: the methods of strings, always available without seed. The methods of strings. They need no seed: - [io](https://plum.elixpo.com/docs/stdlib/io/index.md): The Plumlang io module: standard input, output and error. Standard input, output and error. drop and ask cover most programs; io is for output without… - [os](https://plum.elixpo.com/docs/stdlib/os/index.md): The Plumlang os module: the program's arguments, the environment and running commands. The program's arguments, the environment, and running commands. To… - [time](https://plum.elixpo.com/docs/stdlib/time/index.md): The Plumlang time module: clocks, sleeping and dates. Clocks, sleeping and dates. Times are float seconds since 1970-01-01 00:00 UTC, as time.now() gives… - [fs](https://plum.elixpo.com/docs/stdlib/fs/index.md): The Plumlang fs module: files and directories. Files and directories. Text is read and written as it is (UTF-8, no newline translation), and paths use / on… - [json](https://plum.elixpo.com/docs/stdlib/json/index.md): The Plumlang json module: parse and produce JSON; Json values. Parse and produce JSON. A parsed document is a Json value: take it apart with its methods… - [Json values](https://plum.elixpo.com/docs/stdlib/json-value/index.md): The methods of Json values (from json.parse, or any plain data given the type Json). They need no seed. None of them fail: asking a value for something it… - [Task and Channel](https://plum.elixpo.com/docs/stdlib/task-methods/index.md): The Plumlang Task and Channel: waiting for tasks, channels between them (no seed). The methods of tasks and channels (spec section 12). They need no seed. - [net](https://plum.elixpo.com/docs/stdlib/net/index.md): The Plumlang net module: TCP and UDP sockets, DNS; Listener, Connection, UdpSocket. TCP and UDP sockets, TLS, and DNS. A program that serves many… - [Listener](https://plum.elixpo.com/docs/stdlib/net-listener/index.md): The methods of Listener values from the net module. They need no seed of their own. - [Connection](https://plum.elixpo.com/docs/stdlib/net-connection/index.md): The methods of Connection values from the net module. They need no seed of their own. - [UdpSocket](https://plum.elixpo.com/docs/stdlib/net-udp/index.md): The methods of UdpSocket values from the net module. They need no seed of their own. - [net.http](https://plum.elixpo.com/docs/stdlib/net-http/index.md): The Plumlang net.http module: an HTTP/1.1 server and client, written in Plumlang. An HTTP/1.1 server and client, over plain TCP or TLS (HTTPS). seed… - [hash](https://plum.elixpo.com/docs/stdlib/hash/index.md): The Plumlang hash module: cryptographic digests: SHA-256. Cryptographic digests of text. A digest is a short fingerprint of some bytes: the same bytes… - [Writing a standard module](https://plum.elixpo.com/docs/stdlib/writing-a-module/index.md): A standard module is a table of C functions that Plumlang code calls. This page shows how to add one, using a made-up colour module. Read CONTRIBUTING.md… ## Tools - [Orchard: packages](https://plum.elixpo.com/docs/tools/orchard/index.md): Orchard is Plumlang's package registry. A package is a directory with a plum.toml; Orchard keeps an index of published packages, and the plum command adds… - [The language server: `plum lsp`](https://plum.elixpo.com/docs/tools/lsp/index.md): plum lsp is a Language Server Protocol server built into the plum binary. An editor starts it and talks to it on standard input and output; there is nothing… - [The REPL](https://plum.elixpo.com/docs/tools/repl/index.md): plum with no arguments, on a terminal, starts an interactive prompt: type Plumlang, press Enter, and it runs at once. plum repl does the same and also reads… - [Plumlang in the browser](https://plum.elixpo.com/docs/tools/wasm/index.md): make wasm builds plum for WebAssembly, so a web page can run Plumlang programs without a server: the playground at plum.elixpo.com/playground is built on… ## Error codes - [Error codes](https://plum.elixpo.com/docs/errors/index.md): Every Plumlang compiler error code, from E0101 on, with an example that causes it and the fix. Each code has its own anchor, like /docs/errors/#E0401. ## Optional - [All of the documentation in one file](https://plum.elixpo.com/llms-full.txt): the whole language on one page, then the tour, the language specification, the standard library, the tools (packages, language server, REPL, WebAssembly), and every error code, as Markdown. - [Source code](https://github.com/plumlang/plumlang): the compiler, the virtual machine, the standard library, examples and tests. - [Examples](https://github.com/plumlang/plumlang/tree/main/examples): small complete programs, each with its expected output.