Max Bernstein
bernsteinbear.com · Personal blog · on HN since 2012
Max Bernstein, a compiler engineer, writes about programming language implementation, optimizers, register allocation, and Lisp compilers.
What HN saysHN commenters recommend his Lisp-in-OCaml series and compiler writing, though one finds the OCaml choice hard to follow alongside an unfamiliar topic.
68HN people shared it
19linked it in comments
178stories submitted
5.8Kstory points
3 months agolast shared
2012people per year2026
Most-shared posts
- 1Programming Languages Resources8 people · 8 points · first shared 2021 · discussion on HN
- 2Compiling a Lisp (2020)7 people · 122 points · first shared 2020 · 32 comments on HN
- 3Type information for faster Python C extensions5 people · 11 points · first shared 2024 · 1 comments on HN
- 4Ninja is enough build system5 people · 6 points · first shared 2023 · discussion on HN
- 5Abstract Interpretation in the Toy Optimizer4 people · 97 points · first shared 2024 · 22 comments on HN
- 6Linear scan register allocation on SSA4 people · 61 points · first shared 2025 · 8 comments on HN
- 7A multi-entry CFG design conundrum4 people · 5 points · first shared 2026 · discussion on HN
- 8You can use C-Reduce for any language3 people · 481 points · first shared 2024 · 113 comments on HN
- 9Bytecode compilers and interpreters3 people · 351 points · first shared 2019 · 71 comments on HN
- 10Nix Derivations, Without Guessing3 people · 139 points · first shared 2025 · 64 comments on HN
- 11Compiling a Lisp to x86_64 (2020)3 people · 130 points · first shared 2016 · 31 comments on HN
- 12Introduction to Software Development Tooling (2024)3 people · 125 points · first shared 2024 · 20 comments on HN
- 13Linear Scan with Lifetime Holes3 people · 40 points · first shared 2025 · 1 comments on HN
- 14A Baseline Scrapscript Compiler3 people · 26 points · first shared 2024 · 4 comments on HN
- 15Discovering Basic Blocks3 people · 24 points · first shared 2022 · 11 comments on HN
What HN people wrote when they linked it
tekknolagi · 2026-01-15
https://bernsteinbear.com
I write about programming languages and compilers
cardanome · 2025-08-05
MAL is pretty good, albeit less hand-holding: https://github.com/kanaka/mal
Writing a Lisp in Ocaml: https://bernsteinbear.com/blog/lisp/00_fundamentals/
Not Lisp-specific but Crafting Interpreters is also great: https://craftinginterpreters.com/
sanufar · 2025-07-12
I love this book! I worked through a bunch of it during my winter break last year and found the incremental teaching style extremely rewarding. For readers of the book, Sandler’s reference OCaml implementation is super useful for getting your bearings. I was kind of thrown off by the use of TACKY as an IR, but it was nice to have a solid reference as I worked through the book. For those more experienced with compilers: what are some good resources for stuff like SSA and optimisation? I’ve looked at some of the resources here https://bernsteinbear.com/pl-resources/ but are there other canonical resources?
ngcc_hk · 2024-02-02
His interpreter series is “sadly” in ocaml. See https://bernsteinbear.com/blog/lisp/00_fundamentals/ hard to follow using 2 unfamiliar languages.
tiu · 2025-11-08
The comments are wildly fragmented in this thread. I agree with @torginus, the article has less and less of anything useful to people that want to get into compilers.
Anyways, the "Who .. hires compiler engineer?" section is fairly vague in my opinion, so: AMD, Nvidia, Intel, Apple, Google definitely hire for compiler positions. These hire fairly 'in-open' so probably the best bets all around. Aside from this, Jane Street and Bloomberg also do hire at the peak tier but for that certain language. The off beat options are: Qualcomm, Modular, Amazon (AWS) and ARM. Also see, https://mgaudet.github.io/CompilerJobs/
I seriously attempted getting into compilers last year before realising it is not for me but during those times it felt like people who want to be compiler devs are much much more in number compared to jobs that exist (yes exist, not vacant).
The common way to get going is to do LLVM. Making a compiler is great and all but too many people exist with a lox interpreter-compiler or something taken from the two Go books. Contributing to LLVM (or friends like Carbon, Swift, Rust) or atleast some usage experience is the way. The other side of this is doing GNU GCC and friends but I have seen like only one opening that mentions this way as being relevant. University level courses are rarely of any use.
Lastly, LLVM meetups/conferences are fairly common at most tech hubs and usually have a jobs section listing all requirements.
A few resources since I already made this…
sargstuff · 2022-08-12
Older editions have solutions to the exercises in book available on line (via search engine such as google)
### Some of the following assume an advanced backround:
Structure and Interpretation of Computer Programs , Abelson & Sussman &
Engineering a compiler, K.D. Cooper & L. Torczon
Modern Compiler Design (Worldwide Series in Computer Science),
Build Your Own Programming Language: A programmer's guide to designing compilers, interpreters, and DSLs for solving modern computing problems,
C Jeffery
### Alternate suggestions:
Aho et al. book covers quite a broad variety of topics/discussions.
There are resources that cover more current approaches / more indepth for a given topic/specific subject matter than would be possible in Aho et.
Depending on requirements/needs, on-line resources/courses/topics can provide access to more modern/quicker feedback:
search compiler on https://www.geeksforgeeks.org/
software perspectiv, https://program-transformation.org/
research intensive, look at specific book/documentation on how a language is/was implimented, aka cpython, java, compiling lisp, smalltalk-80, forth
General resource sites (per looking for something less expensive):
https://github.com/aalhour/awesome-compilers / https://bernsteinbear.com/pl-resources/
georgehm · 2026-04-15
I have fond memories of implementing an optimizing compiler for the CS241 compiler course offered back then by Prof Michael Franz who was a student of Niklaus Wirth, probably the most exhilarating course during my time at UC Irvine. This was in 2009 so my memory is vague but I recall he provided a virtual machine for a simple architecture called DLX and the compiler was to generate byte code for it.
Google search points me to https://github.com/cesarghali/PL241-Compiler/blob/master/DLX.pdf for a description of the architecture and possibly https://bernsteinbear.com/assets/img/linear-scan-ra-context-ssa.pdf for the register allocation algorithm
peterfirefly · 2025-09-20
CPS is not that different from SSA.
https://bernsteinbear.com/assets/img/kelsey-ssa-cps.pdf
craftkiller · 2025-05-26
> These hashes are computed using SHA-256
Not so fast! The hash story is actually much more complex than that, as this recent article showed: https://bernsteinbear.com/blog/nix-by-hand/
Regardless, the hash function is irrelevant to end-users, I just thought it was interesting that they cooked up such a convoluted scheme.
leumassuehtam · 2025-05-21
The author has a nice series on compiling a Lisp [0], but unfortunately his search engine fails to find it by querying it with "lisp" or "Lisp".
[0] https://bernsteinbear.com/blog/compiling-a-lisp-0/
surprisetalk · 2025-01-06
Cool people:
• https://tracydurnell.com
• https://www.benkuhn.net
• https://schmud.de
• https://brandur.org
• https://bytes.zone
• https://cassidoo.co
• https://www.chrbutler.com
• https://sive.rs
• https://fasterthanli.me
• https://akkartik.name
• https://www.todepond.com
• https://blog.gingerbeardman.com
• https://gwern.net
• https://interconnected.org
• https://jacobfilipp.com
• https://johnnywebber.com
• https://maggieappleton.com
• https://bernsteinbear.com
• https://pketh.org
• https://rachsmith.com
• https://sonnet.io
• https://stevenscrawls.com
• https://www.bookofjoe.com
• https://winnielim.org
---
Cool directories:
• https://blogs.hn
• https://ooh.directory
• https://deadsimplesites.com
• https://peopleandblogs.com
• https://nownownow.com
• https://blogroll.org
• https://kagi.com/smallweb
sph · 2024-05-27
Look at all of them, then throw them away. Start with a lexer, a parser (pretty easy), the AST is already done, then it's all about the eval loop. All you need is sit down until you understand Lisp's metacircular evaluator (less than 50 lines or code), which is all you need to implement eval.
(I found this while writing this comment: https://bernsteinbear.com/blog/lisp/12_metacircular/)
cess11 · 2024-05-27
Do you imagine it to be especially hard or impossible to replace an interpreter with a compiler instead of implementing a compiler from scratch? It makes it harder to have decided on the language design rather than inventing it in parallel?
From an interpreted Lisp system to a compiler it's mostly a slog of studying compilers and assembly (or machine code) and possibly translating the interpreter, which you can use to bootstrap the compiler implementation if you'd like.
It's common path, see https://mpov.timmorgan.org/i-built-a-lisp-compiler/ and https://bernsteinbear.com/blog/compiling-a-lisp-0/ .
silcoon · 2024-02-02
Compiling a Lisp, the series https://bernsteinbear.com/blog/lisp/
cellularmitosis · 2024-02-01
Whoa, what a treasure trove! https://bernsteinbear.com/pl-resources/
yakubin · 2022-11-22
Casey Muratori's blog (everything stuff): <https://www.computerenhance.com/>
Max Bernstein's blog (compiler stuff): <https://bernsteinbear.com/blog/>
Michael Stapelberg's blog (Linux stuff): <https://michael.stapelberg.ch/posts/>
Göran Weinholt's blog (Scheme stuff): <https://weinholt.se/>
Pr0ject217 · 2022-02-07
EDIT:
Paste this hacky snippet into your browser's console to save all of the links into your clipboard:
(() =>
{
let result = [...document.querySelectorAll('td a')]
.map((link) =>
link &&
!link.href.includes('ycombinator') &&
!link.href.includes('javascript:void')
? link.href
: ''
)
.filter(Boolean);
result = [...new Set(result)];
result.sort();
copy(result.join('\n\n'));
})();
Just to help, here's a compiled-list of all of the links shared here so…
sillysaurusx · 2021-03-30
I wasn't sure whether to submit the overview, or the first chapter: https://bernsteinbear.com/blog/compiling-a-lisp-0/
It's an exceptionally high-quality series, made by HN user tekknolagi: https://news.ycombinator.com/item?id=26627784
ignoramous · 2026-01-03
> This is not what this article does.
Discounting books, many other well written articles on JIT have been shared on HN over the years [0][1][2]; the one I particularly liked as it introduces the trinity in a concise way: Compiler, Interpreter, JIT https://nickdesaulniers.github.io/blog/2015/05/25/interpreter-compiler… / https://archive.vn/HaFlQ (2015).
[0] How to JIT - an introduction, https://eli.thegreenplace.net/2013/11/05/how-to-jit-an-introduction (2013).
[1] Bytecode compilers and interpreters, https://bernsteinbear.com/blog/bytecode-interpreters/ (2019).
[2] Let's build a Simple Interp, https://ruslanspivak.com/lsbasi-part1/ (2015).