Mika Bohinen / NixCon 2026

Trampolining Nix

Open audience

Connecting presentation...

Current

Trampolining Nix

How I nearly lost my mind fighting the evaluator

Mika Bohinen - NixCon 2026

Charlie Kelly tries to explain a wall of papers connected by red string.Kleisli

Next

How far can we take Nix as a programming language?

I wanted to build effects, a type system and an evaluator in Nix.

nix-effects / README.md

Speaker notes

Thank the organizers. Introduce nix-effects as a deliberate exploration of Nix as a programming language: effects, a type system and an evaluator.

Elapsed 0:00 / 40:00 budget
Overview

Arrow keys or Page Up / Page Down navigate. B blanks or restores the audience. F in the audience window toggles its fullscreen. Typing controls keep their keys. Timer recovery resumes paused.

Sum requested memory

Sum the memory requested by service configurations and keep a report of entries missing a port. The report is only needed when requested.

let
Definitions
n = 100000;
entries = builtins.genList
  (i: if builtins.bitAnd i 1 == 0
      then { memoryMiB = 512; }
      else { memoryMiB = 1024; port = 8080; }) n;
makeReport = entries: builtins.toJSON
  (builtins.filter (entry: !(entry ? port)) entries);
diagnostics = makeReport entries;
initial = { total = 0; inherit diagnostics; };
result = builtins.foldl'
  (acc: entry: { total = acc.total + entry.memoryMiB; inherit diagnostics; })
  initial entries;

Empty source

    Inspect the record's fields without asking for the memory total or the report.