Ink by Example — Hello World

Ink by Example: Hello World

Our first program will print the classic "hello world" message. Here's the full source code.

Ink programs are imported by calling load and passing the relative path without .ink. Top level values are brought in as a map.

std := load('../vendor/std')
log := std.log

log('hello world')

We can add comments using the grave accent (U+0060).

` a single line comment `

a multi-line comment

A double accent comments the rest of the line.

`` log('This should not run!')

To run the program, put the code in and run it with the interpreter.

$ ink
hello world

Next example: Values.