1. Get started with Vitte
TL;DR (5 lines)
- A first program must be complete, not decorative.
- The entry contract matters from the beginning.
- A single procedure is enough to teach flow and failure.
- The invalid example should isolate one structural mistake.
- The goal is understanding the whole program shape, not memorizing tokens.
Frequent mistakes
- Teaching a first program as disconnected syntax fragments.
- Adding too many concepts before the reader has one stable executable example.
- Skipping the invalid case that explains why the entry contract matters.
Prerequisites: book/chapters/00-preface.html. See also: book/chapters/00-preface.html, book/chapters/27-grammar.html, book/chapters/31-build-errors.html.
Concrete Problem
Beginners often see the first file as a bag of syntax instead of the smallest end-to-end executable program.
Red Thread (Single Project)
The same first project grows from one entry point to a file with data, a procedure, a check, and one visible exit code.
For what
This chapter helps a new reader build and understand the first complete Vitte program.
What you are going to do
You will read one minimal project, identify the essential pieces, then inspect one broken variant and the reason it fails.
Coherent example
space demo/starting
proc greet(name: string) -> int {
if name == "" { give 11 }
give 0
}
entry main at core/app {
return greet("world")
}
Global explanation
The first chapter should prove one thing clearly: a Vitte project is an entry point, a small contract, and an observable result. That is enough to understand before learning richer constructs.
Invalid case
entry main {
return 0
}
This invalid case is intentionally small. It exists to isolate the contract failure that the chapter is trying to teach.
Common pitfalls
- Teaching a first program as disconnected syntax fragments.
- Adding too many concepts before the reader has one stable executable example.
- Skipping the invalid case that explains why the entry contract matters.
Short exercise
Extend the example with one small data form and keep the same clean flow from input to exit code.
Summary in 5 points
- A first program must be complete, not decorative.
- The entry contract matters from the beginning.
- A single procedure is enough to teach flow and failure.
- The invalid example should isolate one structural mistake.
- The goal is understanding the whole program shape, not memorizing tokens.
Mini quiz
- What contract is the coherent example trying to make explicit?
- Why does the invalid example fail?
- What boundary should remain visible if you extend the example?
See also
Next best action
Extend the coherent example by one small, justified step and keep the same contract visible from input to output.