1. First Program

Level: beginner · Reading time: 3 min · Prerequisite: book/poche/00-how-to-read.html · Last review: 2026-05-09

TL;DR (5 lines)

  • Read the core idea first.
  • Understand one concept at a time.
  • Run small examples.
  • Fix errors early.
  • Move to next chapter only when clear.

Frequent mistakes

  • Skipping prerequisites.
  • Reading without trying examples.
  • Fixing too many errors at once.

Prerequisites: book/poche/00-how-to-read.html. See also: book/chapters/01-starting.html.

Goal

Run a program that returns a value.

Example

entry main at app/demo {
  return 0
}

Why it matters

This pattern is the basis for all the following exercises.

Quick check

What happens if you replace 0 with 1?

Try this

  1. Copy the snippet.
  2. Compile.
  3. Check the return.

If you're stuck

The code above is sufficient: it is valid, readable and executable.

See also

Next best action

Apply one idea from this chapter in a tiny example, then continue.