November 1, 2025
No jumps, big jump scare
NJVL: Nim's New Intermediate Representation
Fans cheer, skeptics side-eye: Nim’s “no jumps” IR shakes up the crowd
TLDR: Nim unveiled NJVL, a new internal compiler language that replaces jumps with simple flags to make optimization easier. The crowd is split: fans say it simplifies analysis and enables native assembly; skeptics worry about trust and inconsistent evaluation order across backends, making its promise feel shaky.
Nim just dropped NJVL, a new “in-between” language for its compiler that promises no jumps and “versioned” variables—think tidy, predictable code paths that make optimization easier. Devs say it could streamline everything from removing duplicate work to speeding up loops, and even pave the way for easier native assembly.
But the comment section immediately turned into a tech soap opera. One confused fan asked if this was basically Python’s .pyc files (short answer: no—IR is a compiler’s internal blueprint, not a portable bytecode you run). Another commenter stirred the pot, calling Nim “almost a pet project of a single individual,” sparking a trust-versus-genius debate: is this bold innovation or a risky one-man moonshot? Supporters countered that NJVL’s design makes analysis and memory safety simpler and sets the stage for better backends across C, C++, JavaScript, and raw assembly.
Then came the spicy technical take: a critic pointed out there’s no guaranteed evaluation order across backends, hinting NJVL’s pretty tree-structure might not behave consistently (issue link). Cue memes: “No Jumps IR… that jumps later,” and “Monotonic booleans—once true, never going back (like my ex).” Verdict? NJVL is clever, controversial, and very Nim: ambitious tools, loud reactions.
Key Points
- •NJVL is a structured IR for Nimony that replaces unstructured control flow with boolean control-flow variables (cfvars) and versions all data locations.
- •The transformation occurs in two phases: nj (simplifies control flow) and vl (adds version information to locations).
- •jtrue is a multi-assignment instruction that sets one or more cfvars to true; cfvars are monotonic and tested only in ite or loop conditions.
- •Returns, breaks, short-circuit and/or, raises, and exception-prone calls are rewritten into data-flow plus guards using cfvars.
- •NJVL supports a range of optimizations (e.g., CSE, copy propagation, loop-invariant code motion, vectorization) and can represent CPS.