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

  1. Building ASTs in macros

    Lesson 1 · On the house

    Building ASTs in macros

    Construct NimNodes with newTree, newCall, ident, and newLit, and walk typed arguments.

  2. A DSL with macros

    Lesson 2

    A DSL with macros

    Turn a declarative block into code: a small routing table and state machine generated at compile time.

  3. Lifetime hooks

    Lesson 3

    Lifetime hooks

    Custom =destroy, =copy, =sink, and =wasMoved for resource-owning types.

  4. C interop

    Lesson 4

    C interop

    importc, header, cstring, varargs, and wrapping C functions safely.

  5. The effect system

    Lesson 5

    The effect system

    func and noSideEffect, raises lists, tags, and gcsafe for checked guarantees.

  6. Custom pragmas and introspection

    Lesson 6

    Custom pragmas and introspection

    Annotate fields with your own pragmas and read them with hasCustomPragma and getCustomPragmaVal.

  7. Unsafe code: ptr, addr, and cast

    Lesson 7

    Unsafe code: ptr, addr, and cast

    Raw pointers, address-of, pointer arithmetic via UncheckedArray, and reinterpretation with cast.

  8. static parameters and generic specialization

    Lesson 8

    static parameters and generic specialization

    static[T] values in types, compile-time sizes, and overloads chosen per type.

  9. Testing and assertions

    Lesson 9

    Testing and assertions

    std/unittest suites, check vs require, doAssert vs assert, and testament.

  10. Packaging, build flags, and release builds

    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.

All lessons