Wave documentation and learning guide
Learn Wave step by step, from installation to practical programs, and look up language rules and standard library APIs.
Wave Foundation
Learn Wave with this guide
Learn to write Wave source code, compile and run it, and check the results. If you are new to programming, follow the sequence below. If you know another language, run each chapter’s examples and compare its rules and boundary cases with what you already know.
Learning path
| Step | Chapter | What you will learn |
|---|---|---|
| Setup | Installation | Prepare the compiler and standard library and verify that they run |
| 1 | Your first program | Create, check, and run a source file and understand exit codes |
| 2 | Variables and types | Store values and choose types with the required range |
| 3 | Operators and conversions | Explain evaluation order and the results of type conversions |
| 4 | Conditions and loops | Branch on conditions and process data with loops |
| 5 | Functions | Extract repeated operations into functions |
| 6 | Arrays | Access elements by index and iterate over an array |
| 7 | Strings | Distinguish characters from bytes and understand escapes and string length |
| 8 | Structs and variants | Group related data and represent success and failure |
| 9 | Pointers and lifetimes | Modify the original value through its address and manage its lifetime |
| 10 | Dynamic memory | Handle allocation failures and free memory |
| 11 | Modules and generics | Split code across files and reuse functions with different types |
| 12 | Error handling | Check results and clean up resources on failure |
| 13 | Introduction to asynchronous code | Create a Future and wait for it to finish |
Put your knowledge into practice
After the core chapters, build an input calculator, a file reader, a binary message, and a TCP client. Test both successful input and failure cases in each project.
Three documentation tabs
- Wave: A guided language course and practical projects to follow in order.
- Standard library: Each module’s APIs, return values, errors, ownership rules, and platform requirements.
- Whale: Building and linking, package management, command usage, and the low-level toolchain.
Examples distinguish complete programs from snippets that belong inside a function. Run wavec commands in a terminal and save wave code blocks in .wave files. Input and output are shown separately; examples that read standard input specify what to enter.
When you get stuck
Use Troubleshooting to distinguish installation, source checking, linking, and execution problems. Look up language rules in the syntax quick reference, commands in the compiler reference, and APIs in the standard library guide.