iPX Directory

Directory Technology

Max Bernstein's Blog

1 person subscribes

Paste it into any podcast app or feed reader to subscribe.

Latest posts

Linear scan register allocation in Datalog

Note: This was supposed to be published basically immediately after PLDI 2026 but I got hung up on posting it because I am not a Datalog native like Yannis is and I like understanding everything I post. But I guess that’s what expert co-authors are for, right? It’s a little rough but it’s been so long that the editing is holding up the posting. Happy reading. Last year I wrote my first register al

21 Nov 2026
Inside PyPy: first contact with RPython

I get restless now and then and I want to implement a programming language. Then after mustering the resolve, I stew, for there is no good implementation language. 1 What am I to do, build my own programming language so that I can then use it to implement the first language? So I go back to modifying an existing implementation instead. There do exist established general-purpose tools for building

19 Nov 2026
SSA from bytecode: imperative pearl

Ufuk made a comment that he enjoyed my description of SSA from bytecode in Aaron’s livestream with me . While filming the livestream—an intro to ZJIT internals—I got a little nervous that people would shy away from our 1900 line add_iseq_to_hir function. This function is responsible for converting CRuby’s stack based bytecode for the YARV virtual machine into a high-level SSA IR for ZJIT to analyz

12 Nov 2026
I am searching for a coffee alternative

I had an in-person work team meeting last week. In the office, they had Bevi seltzer machines. When Bevi machines first arrived at Facebook, where I used to work, I looked down on them. They seemed to be a cost reduction, a sad imitation of The Good Stuff that came in cans and bottles in the fridge. Good Stuff such as LaCroix 1 and Ito En tea 2 . But this week was different. I noticed that this Be

10 Nov 2026
Rails is a JIT compiler

Originally published on Rails At Scale . The title was bait to get you to open this article. But fear not! We will be generating code at run-time today. (See the PR for a sneak peek.) Sam popped into the JIT channel asking how we might optimize Rails enums in Roundhouse, motivated by the following code snippet: class Order < ActiveRecord :: Base enum :status , { pending: 0 , paid: 1 , shipped: 2 ,

21 Oct 2026
Objects, attributes, maps, oh my!

Or, IC UC we all C for ICs . In many dynamically typed programming languages, objects look like a big ol’ mapping of names to values. The languages encourage this flexibility. Consider for example Python: class C : def __init__ ( self ): self . a = 1 self . b = 2 Or Ruby: class C def initialize @a = 1 @b = 2 end end Or JavaScript 1 : let obj = {}; obj . a = 1 ; obj . b = 2 ; This might encourage t

21 Oct 2026
Support Local Variables

Discovering and supporting all of the wild semantics for local variables in Ruby was so interesting that the ZJIT team decided to write a paper about it: Support Local Variables (PDF). It’s also the first bit of academic literature that documents and explains ZJIT. It’s published at VMIL 2026, where someone on our team will be presenting it. Abstract Ruby is a dynamically typed and object-oriented

4 Sep 2026
Another partial SSI trick with canonicalize

See the previous post for context and explanation of SSI . After reading Chris Fallin’s aegraph post , new ZJIT contributor dak2 landed a block-local version of the canonicalize function in #16828 . The pseudocode of the block-local canonicalize function looks like this: for block in function . reverse_post_order (): rewrite_map = {} for insn in block . insns : insn . operands . map_in_place ( lam

13 Aug 2026
A quick look at zero-knowledge proofs

NB: This isn’t about crypto. I don’t care about crypto. Chris messaged me the other week asking if I wanted to implement zero-knowledge proofs. I initially was not interested, but then he said: What if I told you there’s a version of them that has nothing to do with cryptocurrencies? What if I told you it involves graph theory? What if I told you there’s a 30 line implementation? Now that was inte

7 Aug 2026
The inliner is yielding benefits for ZJIT

Originally published on Rails At Scale . We recently enabled a really cool feature in ZJIT that makes it feel like a Real Compiler™: the inliner! We’ll write more about it soon. In this post, we’ll talk about one excellent concrete benefit we are already seeing and how it optimizes blocks in pretty much every Ruby program. I’ll start off with a refresher on how blocks work in the Ruby interpreter,

28 Jul 2026
Sorry for marking all the posts as unread

I noticed that the URLs were all a little off (had two slashes instead of one) and went in and fixed it. I did not think everyone's RSS software was going to freak out the way it did. PS: this is a special RSS-only post that is not visible on the site. Enjoy.

31 Jan 2024