Learn AffineScript from zero to hero in 10 progressive lessons.
Each lesson builds on the previous one. Complete them in order for the best experience.
| Lesson | Topic | Time | Status |
|---|---|---|---|
Hello AffineScript - Variables, types, arithmetic |
15 min |
✅ Complete |
|
2 |
Functions & Pattern Matching - Define functions, match expressions |
20 min |
🔄 In Progress |
3 |
Affine Types Basics - Ownership, move semantics |
25 min |
📝 Planned |
4 |
Borrowing & References - |
25 min |
📝 Planned |
5 |
Dependent Types - Length-indexed vectors, type-level computation |
30 min |
📝 Planned |
6 |
Refinement Types - Compile-time constraints, safe division |
25 min |
📝 Planned |
7 |
Effect System - Tracking I/O, exceptions, purity |
30 min |
📝 Planned |
8 |
Row Polymorphism - Structural typing, flexible records |
25 min |
📝 Planned |
9 |
Error Handling - |
30 min |
📝 Planned |
10 |
Building Real Programs - Putting it all together |
40 min |
📝 Planned |
Total time: ~4.5 hours
-
Basic programming experience (any language)
-
Familiarity with variables, functions, types
-
No prior functional programming knowledge required
-
Open the Playground
-
Load the lesson example (e.g.,
examples/lessons/01_hello.affine) -
Follow along by running code as you read
By the end of this course, you’ll understand:
✅ Basic Syntax - Variables, functions, types ✅ Affine Types - Resource safety without complexity ✅ Dependent Types - Compile-time correctness proofs ✅ Refinement Types - Constrained values (non-zero, positive, etc.) ✅ Effect System - Track side effects in types ✅ Row Polymorphism - Flexible structural typing ✅ Error Handling - Option, Result, exceptions
And you’ll be able to: - Write type-safe, memory-safe programs - Prove correctness at compile time - Build real applications with confidence
-
What Makes AffineScript Brilliant - Why learn this language?
-
Language Specification - Complete formal spec
-
Playground - Try it in your browser
-
Examples - More code samples
-
Questions? Open an issue on GitHub
-
Found a bug in lessons? PRs welcome!
-
Want to contribute? See CONTRIBUTING.md
Ready? → Lesson 1: Hello AffineScript →
Not sure if this is for you? → What Makes It Brilliant