Lessons
Nim · Expert
Nim · Expert. Ten lessons. Open-book quizzes. Lesson 1 free.
10 lessons · The Host · Lesson 1 free
Pass all ten lessons for the certificate. Sample · Claim

Lesson 1 · On the house
Building ASTs in macros
Construct NimNodes with newTree, newCall, ident, and newLit, and walk typed arguments.

Lesson 2
A DSL with macros
Turn a declarative block into code: a small routing table and state machine generated at compile time.

Lesson 3
Lifetime hooks
Custom =destroy, =copy, =sink, and =wasMoved for resource-owning types.

Lesson 4
C interop
importc, header, cstring, varargs, and wrapping C functions safely.

Lesson 5
The effect system
func and noSideEffect, raises lists, tags, and gcsafe for checked guarantees.

Lesson 6
Custom pragmas and introspection
Annotate fields with your own pragmas and read them with hasCustomPragma and getCustomPragmaVal.

Lesson 7
Unsafe code: ptr, addr, and cast
Raw pointers, address-of, pointer arithmetic via UncheckedArray, and reinterpretation with cast.

Lesson 8
static parameters and generic specialization
static[T] values in types, compile-time sizes, and overloads chosen per type.

Lesson 9
Testing and assertions
std/unittest suites, check vs require, doAssert vs assert, and testament.

Lesson 10
Packaging, build flags, and release builds
nimble projects, config.nims, -d:release vs -d:danger, LTO, and cross-compiling.
Sample certificate
Certificate of completion
Sign in to claim your certificate of completion.
Certificate
Finish all ten lessons, then sign in
Pass every lesson on this device (quizzes and checks). Then sign in or create an account to type your name and download the JPG.