Quadratic Micropass Type Inference

Mind‑reading compiler idea has devs cheering—and speed freaks sweating

TLDR: A new approach promises clearer, more human-friendly compiler error messages by reordering how it guesses types, but it might be slower. Commenters are split: some are excited, while others demand benchmarks, question subjective priorities, and worry it could reject more code than standard methods.

A new proposal called “Quadratic Micropass Type Inference” claims it can make compilers feel more human by guessing types in the order people actually think, leading to clearer, kinder error messages. Instead of one big brain dump, it runs many small passes and re-runs earlier ones to prioritize what users care about first. Sounds dreamy, right? The internet answered: “Maybe… if it isn’t slow.” Read the proposal.

The hype squad loved the promise of friendlier errors, but the comment section turned into a speed trial. One top reply cheered the idea, then slammed the brakes on the word “quadratic”—dev-speak for “this might get slow fast.” Others demanded real benchmarks with a baseline, not just vibes. Meanwhile, a skeptic fired back that “what users care about” changes by person and context, casting doubt on whether a one-size-fits-all priority can exist. Another voice asked for side-by-side error comparisons with the classic approach and wondered if this new system might reject more programs than today’s methods.

Memes rolled in: “Compiler, read my mind challenge,” and “Quadratic Micropass sounds like a new gym class.” Bottom line: clearer errors vs. potential slowdown is the fight, and the crowd wants receipts before crowning this a mind reader.

Key Points

  • The article proposes a multi-pass type inference algorithm that prioritizes unifications by user relevance rather than source order.
  • It contrasts inside-out inference with type variable unification, noting limitations in error clarity when early unifications are misleading.
  • The approach structures inference into ordered passes: known_applications, known_assignments, known_return_types, known_same_as_unifications, known_record_fields, resolve_records, less_known_functions, default_numbers, default_unknown_to_unit_or_lift.
  • Each pass applies minimal changes and then re-runs all prior passes to propagate new type information.
  • Error detection is deferred: inference passes ignore errors, and error generation is handled during type checking.

Hottest takes

"the quadratic performance of the title sounds a bit worrying" — edmundgoodman
"the desirable priority is context and programmer-dependent" — ux266478
"won't this type less programs than bidirectional type inference?" — nextaccountic
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.