Choose a starting point that fits your programming experience. Five lessons take you from a study-plan calculation to a tested application you can run outside its source folder.
Choose your route
For the full introduction, follow Home → Introducing Topaz → First Program. Then continue through Values and Functions, Data and Control, Failures and Resources, and First Application below.
If you already write programs, start with Coming From Other Languages. Compare the syntax you know and choose the lessons you need.
If programming is new to you, What a Program Is is an optional introduction before First Program. Keep Syntax at a Glance beside the lessons to look up examples as you work.
What you will build
Each lesson extends the study-plan program and ends with a working result.
- First Program prints a study topic and its duration. Check and run the file, then fix a type error.
- Values and Functions calculates the minutes left with a function and updates a session counter. Choose when to write a type and when to let Topaz infer it.
- Data and Control stores tasks with titles, durations, and completion states. Use
if,match, andforto label tasks and total their remaining time. - Failures and Resources reports invalid input and runs a cleanup action with
defer. UseOption,Result, and?, then inspect an array access that stops the program with an error. - First Application splits the program into
src/main.tpzandsrc/plan.tpz. Add tests, lock package dependencies, and build a native executable.
In the final lesson, run the built application from a separate folder with no .tpz files or Topaz compiler. It prints tasks=2, remaining=25 minutes.
Choose browser or local tools
Use the Playground to edit and run the short programs from the first four lessons without installing Topaz. The file commands in those lessons use a local terminal.
Install Topaz locally to follow those commands and complete First Application. First Program explains installation. You need a text editor and basic terminal skills. The final native build also needs the Rust tools for your platform.
You can start in the browser and install the tools before First Application. Package registries, WASM packages, and compiler internals can wait until after the course.
Try this
You want to change a calculation now and build an executable later. Where can you start, and when will you need local tools?
Answer
Start in the Playground. Before First Application, install Topaz and the Rust tools so you can create files, run tests, and build the executable.
Ready to continue when
You have chosen a route and a place to run the examples. Open First Program to begin the five lessons.