“Compiler Explorer” is the name of a fascinating project by Matt Godbolt, a British C++ software developer living in Chicago. It is the simplest and most wonderful thing; just paste a snippet of code on the left pane (in C, C++, D, C#, Java, Python, and a myriad more languages), and you will see on the right its equivalent in assembly code, as produced by one of a long list of compilers, including some commercial ones, for a wide variety of CPU architectures and software versions.
The default example, when you access the website for the first time, converts (at the time of this publication) the C++ code below,
// Type your code here, or load an example.
int square(int num) {
return num * num;
}
into the following x86-64 assembly code, as compiled by GCC 15.1:
square(int):
push rbp
mov rbp, rsp
mov DWORD PTR [rbp-4], edi
mov eax, DWORD PTR [rbp-4]
imul eax, eax
pop rbp
ret
(As you can imagine, the line imul eax, eax
is the one performing the actual squaring of a number; the rest is just bookkeeping and ABI compliance.)
Not only that, but this gem of an open source project highlights the equivalent instructions between the C++ code and the resulting assembly using the same colors. The fun begins when you change the target CPU architecture (ARM, RISC-V, POWER, SPARC, MIPS, etc.) or the word length (32 or 64 bits), and you realize the diversity therein… even though all of those assembly snippets, from the point of view of the user, essentially do the same thing.
For example, the same C++ code, using the same GCC 15.1 compiler, produces the following ARM64 assembly:
square(int):
sub sp, sp, #16
str w0, [sp, 12]
ldr w0, [sp, 12]
mul w0, w0, w0
add sp, sp, 16
ret
(Again, the line mul w0, w0, w0
needs no explanation.)
Compiler Explorer is a humbling and refreshing look at the compiler, the ultimate developer tool, the one that has singlehandedly defined developer experience during the past 73 years. The one that provided a very welcome layer of translation between humans and machines, allowing people to represent algorithms and data structures with a language akin to English or mathematics, all while enabling the porting of software across platforms as a bonus.
After overcoming the initial skepticism (“I can generate much better machine code that this thing!” dixit operators in front of an IBM 1401), compilers have grown in sophistication. They have evolved from the single-pass BASIC compiler of Dartmouth in 1964 and the typeless, simple BCPL compiler of 1967, to the powerful LLVM infrastructure enabling a strongly-typed language like Rust.
It seems to me that we have reached a summit in compiler extravaganza. The four wonders of the compilation world, are all open-source, free as in beer as free as in freedom, and each has enabled successive revolutions of its own: GCC, LLVM, V8, and GraalVM.
In particular, I have often considered LLVM (kids: that is not the same as “LLM”, keep on reading to learn more) as the biggest breakthrough in software technology of the past few decades. Just to give everyone an idea, this is the compiler framework that begat Clang, Rust, Emscripten, Zig, and Swift. It is hard to overstate the importance of the work that Chris Lattner has given the world for free.
But we are in 2025, so for the purposes of this article I literally asked ChatGPT the same question (that is, to translate the snippet of C++ code above into the flavors of assembly chosen previously), and it did not disappoint, bookkeeping and ABI compliance notwithstanding.
I have recently blogged about “vibe coding” the C version of a personal project of mine, and making it compatible with C89, an old but widely supported standard of C in retrocomputing environments, with extraordinary results.
Have I cared about the compilers themselves during the exploration process that led to my article? Yes, but admittedly at a very superficial level; the biggest concern was, as you can imagine, the syntax of flags and arguments to pass at the command-line level, and how to find the proper preprocessor macro that identified each of those compilers of yore. Said complexity would be, in turn, abstracted away on a script or a Makefile
, and promptly forgotten.
Gone are the days of debating whether a language was Turing Complete or not; gone are the days of YACC and Backus-Naur forms; gone are the days of CompCert.
Precisely, software developers have been abstracting themselves from the computer, in a slow but steady process. And we continue to do so right now with LLMs, “Copilots”, and similar contraptions. “Automatic Programming” as the one promised by Remington Rand’s FLOW-MATIC in 1957 led to higher and higher levels of abstraction and type checking, to finally a know-it-all chatbot that will ultimately make ours an obsolete and vintage profession worthy of a museum.
Despite their naming similarities, LLVM and LLM are truly very different things. Compilers are predictable and deterministic machines; same input code, with same flags and under the same versions, produce the same output. LLMs, and its associated new kid on the block, “vibe coding”, are based on a random, statistical, and unpredictable machine.
But as we have argued before, we have opened Pandora’s Box, and we cannot go back in time. We have to contend with LLMs today, whether we like it or not. That means that we have to teach younger generations of software developers not only how to use these new tools, but also the intricacies of the lower-level, deterministic, arguably old-fashioned compilers that made our craft possible during the past seven decades.
We cannot preclude developers from “vibe coding” their way into a working application; but we can teach them how to properly integrate the very likely spaghetti mess produced by those bullshit machines, how to understand it, and how to make it work with today’s compilers, which, let us be honest: are the best we have ever had, and it would be a shame to ignore them completely. And Godbolt’s Compiler Explorer is an extraordinary tool for that matter.
We must, however, make sure that their human skills stay valuable in the workplace, teaching them all the empathy, writing skills, and ethics that you cannot neither embed in the source code of a compiler, nor feed into an LLM.
Cover photo by Igor Omilaev on Unsplash.