Tour · Step 1 of 11
Hello, world
Here is a whole Plumlang program:
drop("Hello, world!")Hello, world!drop prints its values on a line of their own. There is no main
function to write and nothing to import: a program starts at its first line
and runs to its last.
Running it
Save the program as hello.plum and run it:
plum run hello.plum # or just: plum hello.plumplum first checks the whole program, then runs it. If there is a mistake,
it says where, and usually how to fix it, before anything runs.
Printing several things
drop takes any number of values, of any type, and separates them with a
space:
drop("The answer is", 42)
drop(1, 2.5, good)
drop()
drop("done")The answer is 42
1 2.5 good
donedrop() with nothing in it prints an empty line. good is how Plumlang
spells true; you'll meet it again in the next step.
Comments
A # starts a comment, which runs to the end of the line. Plumlang ignores
it; it is there for people reading the code.
# Greet the reader.
drop("Hello") # a comment can follow code tooHelloOne statement per line
A statement ends at the end of its line; there are no semicolons. A long statement can carry on to the next line when the line ends inside brackets, or with an operator or a comma:
drop("one",
"two")one twoNext: values and variables.