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

Quick Start

Now that Henceforth is installed, let’s write and run a simple Hello World program. This guide will help you go from zero to a running program in just a few steps.

1. Create a new file

First, create a new directory and a file for your program:

$ mkdir hello-world
$ cd hello-world
$ touch main.hfs

2. Write your first program

Open main.hfs in your favorite text editor and add the following code:

fn main: () -> () {
  @("Hello, world!") &> print;
}

This simple program prints “Hello, world!” to the terminal. If you don’t understand some of the syntax, you can learn about it in the next section, or in the language reference.

3. Run the program

Once your file is ready, run it from the command line:

$ henceforth main.hfs
Hello, world!

4. What’s next?

You’re all set up and running code! In the next section, you’ll get a glimpse into some of the language features.