Elektrine lite

← Feed

@jack@berlin.social

2026-03-22 14:33 UTC

I implemented the Nimble type inference algorithm from Henry Baker's old Common Lisp paper in Clojure awhile back for #reasons. It's based on lattice/algebraic data flow (Kaplan-Ullman) rather than logical unification (Milner), and works well to calculate type specialization while compiling dynamic languages: https://www.plover.com/misc/hbaker-archive/TInference.html Yesterday I added a simple C generator to make something like Pre-Scheme <https://prescheme.org> for #Clojure…

Replies (3)

  • @jack@berlin.social 2026-03-24 11:45

    I couldn't leave it alone, so now it correctly refuses to emit C until it can ground every expression in a C-compatible type (type hints can be used to resolve ambiguities), and the generated C compiles to perfectly good WASM modules. This is now dangerously close to being useful. 🤔

    Open ##1385935

  • @abnv@fantastic.earth 2026-03-22 14:58

    @jack wow, exactly what I was looking for today to implement in my compiler for a JS like dynamically typed language. Thanks! Do you think it would work my non-lisp language?

    Open ##1385937

  • @nixfreak@masto.hackers.town 2026-03-24 12:04

    @jack why not take over #prescheme since it got abandoned it looks like. https://codeberg.org/prescheme/prescheme

    Open ##1385949