Tour
A tour of Plumlang
Learn the language in eleven short steps, each with programs you can run.
Each step is one idea, with small complete programs and the output they print. No programming experience is assumed.
The keywords keep a garden theme: you plant a variable, drop a value on
the screen, grow a branch (a function) and a tree (a class), and seed
a module. Everything else reads like English: and, or, not, if,
for.
How to follow along
Install Plumlang, save a program in a file ending in
.plum, and run it:
plum check hello.plum # find mistakes, run nothing
plum run hello.plum # run itThe steps
- Hello, world: printing, comments and running a program.
- Values and variables: numbers, text,
plantandroot. - Making decisions and loops:
if,match,whileandfor. - Functions:
branch, default and named arguments, lambdas. - Lists, maps and missing values: collections and
none. - Trees: your own types: fields, methods and inheritance.
- Traits and kinds: shared behaviour and fixed sets of cases.
- When things go wrong: compile errors,
throw,tryandcatch. - Modules:
seed, the standard library and programs of several files. - Tasks: doing several things at once with
spawnand channels. - A web server:
net.httpin a few lines.
The tour shows the common path. The language reference has the exact rules, and the standard library documents every module.