- Author
- Max Bernstein
- Published
- November 11, 2025
- Kind
- Personal blog post, a survey of existing compiler source code
- Original
- bernsteinbear.com/blog/compiler-effects/
- Subject
- Compilers and interpreters
- Themes
- Close to the machine
What it is
Max Bernstein writes a blog about programming languages. This post surveys how compilers track side effects in their intermediate representation. The author says the aim is to summarize the landscape. The author is deciding how to represent effects.
What it says
- Bernstein says effects tell a compiler which instructions can be reordered, duplicated or removed.
- The post says over-approximating effects is always valid. A first compiler can treat every instruction as maximally effectful.
- Cinder uses a bitset. Each bit is a disjoint heap location, such as list items.
- JavaScriptCore uses nested integer ranges, numbered from an abstract heap tree.
- Bernstein reports that Fil Pizlo prefers ranges because bitsets get expensive beyond 128 bits.
- The post says DOM builtin calls carry effect annotations. The JIT can then optimize around them.
- The post concludes that bitsets and int ranges are both fine. Sea of Nodes is probably fine too.
What evidence it gives
The post quotes source code from Cinder and JavaScriptCore. It shows a generator the author modified to emit both forms. It links to code in HHVM, Android ART, CoreCLR and V8. It runs no benchmarks.
Interests and limits
The author is still deciding on a design. The author admits not fully understanding some JavaScriptCore details. The Simple section is described as harder to understand. No performance comparison is given, so the conclusion rests on reading code and one conversation.
Connections
These links are this wiki's own reading, not claims the sources make.
- Bloom Filters. A Bloom filter may say maybe, but never a false no. An over-approximated effect may block a valid reorder, but never permits a wrong one. Both stay safe by erring in one chosen direction. What would a one-sided guarantee look like for agent memory?