Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Hello, World

Create a file called hello.lil:

write("hello, world")

Run it:

lil hello.lil

In Python you write print("hello") with parentheses. In lil, write("hello") is a function call with parentheses.

The write() function outputs text to stdout and appends a newline:

write(42)
write("hello")

You can write multiple values by separating them with commas:

write("the answer is", 42)

This prints: the answer is 42

Write with a variable:

name = "alice"
write("hello", name)