Hacker News with Generative AI: Compilers

V8: From CFG to Sea of Nodes and back again (v8.dev)
V8’s end-tier optimizing compiler, Turbofan, is famously one of the few large-scale production compilers to use Sea of Nodes (SoN). However, since almost 3 years ago, we’ve started to get rid of Sea of Nodes and fall back to a more traditional Control-Flow Graph (CFG) Intermediate Representation (IR), which we named Turboshaft.
Compiler Options Hardening Guide for C and C++ (openssf.org)
This document is a guide for compiler and linker options that contribute to delivering reliable and secure code using native (or cross) toolchains for C and C++.
A simple, possibly correct, LR parser for C11 (archives-ouvertes.fr)
Tail Call Recursion in Java with ASM (2023) (unlinkedlist.org)
One kind of optimization offered by some compilers is tail call optimization. This optimization does not bring much, since the programmer can always tailor his code without recursion, especially in an imperative language. On the other side, recursive code often times more elegant, so why we don’t let the compiler do the nasty stuff when it is possible? In this article I will present a neat way to implement tail call optimization in Java using byte code manipulation with ASM.
LLVM Back End for MoonBit (moonbitlang.com)
In the past two years, MoonBit has demonstrated significant performance advantages across WebAssembly, JavaScript, and native backends. We believe that for a new language to be truly valuable, it must offer a generational leap in both core performance and developer experience. Today, we are excited to introduce MoonBit LLVM backend support with 8× the performance of Java in the FFT benchmark, and out-of-the-box debugging.
Building Node.js on Windows with Clang-cl (joyeecheung.github.io)
Recently Node.js started to support building with clang-cl on Windows.
What it takes to add a new back end to Futhark (futhark-lang.org)
Recently Scott Pakin suggested writing a blog post on how to add a new backend to the Futhark compiler, and since there’s active fiddling with the backends at this very moment, this is not a bad idea.
C++26 Expansion Tricks (pydong.org)
P1306 gives us compile time repetition of a statement for each element of a range - what if we instead want the elements as a pack without introducing a new function scope?
C++26 Expansion Tricks (pydong.org)
P1306 gives us compile time repetition of a statement for each element of a range - what if we instead want the elements as a pack without introducing a new function scope?
Another Round of Rust Compiler Improvements Merged for GCC 15.1 (phoronix.com)
Relocation Generation in Assemblers (maskray.me)
This post explores how GNU Assembler and LLVM integrated assembler generate relocations, an important step to generate a relocatable file.
I spent 181 minutes waiting for the Zig compiler this week (zackoverflow.dev)
TLDR; The Zig compiler takes about 1 minute and 30 seconds to compile debug builds of Bun. Zig's language server doesn't do basic things like type-checking, so often have to run the compiler to see if my code works.
I spent 181 minutes waiting for the Zig compiler this week (zackoverflow.dev)
TLDR; The Zig compiler takes about 1 minute and 30 seconds to compile debug builds of Bun. Zig's language server doesn't do basic things like type-checking, so often have to run the compiler to see if my code works.
Representing Type Lattices Compactly (bernsteinbear.com)
The Cinder JIT compiler does some cool stuff with how they represent types so I’m going to share it with you here. The core of it is thinking about types as sets (lattices, even), and picking a compact representation. Compilers will create and manipulate types with abandon, so all operations have to be fast.
COBOL Language Front End Merged for GCC 15 Compiler (phoronix.com)
A big albeit late feature landed today for the upcoming GCC 15 compiler... The COBOL programming language front-end has been merged!
Compiling C++ with the Clang API (maskray.me)
This post describes how to compile a single C++ source file to an object file with the Clang API.
Introduction to MLIR and Modern Compilers (vectorfold.studio)
MLIR is a newer project within the LLVM ecosystem, designed to address the challenges of modern hardware accelerators and machine learning frameworks.
LFortran compiles PRIMA (lfortran.org)
We’re thrilled to share that LFortran can now successfully compile and execute libprima/PRIMA. PRIMA marks the eighth production-grade, third-party code that LFortran has compiled with bit-for-bit alignment to GFortran’s output. This milestone brings us closer to our goal of compiling 10 such codes—an essential step toward achieving a beta-quality compiler.
Building Query Compilers [pdf] (uni-mannheim.de)
Show HN: Compiler Playground for energy-efficient embedded dataflow processor (efficient.computer)
We’re excited to announce the official launch of our effcc Compiler Playground, a new, interactive software ecosystem for our processor.
GCC 15, now with C++ modules support (gcc.gnu.org)
This page is a "brief" summary of some of the huge number of improvements in GCC 15.
Bootstrapping a Small-C compiler for transputer and Operating System in 1995 (nanochess.org)
This isn't your modern C compiler booting on a recent processor. Instead, you'll read about how I bootstrapped a C compiler in a transputer processor, while providing it with a basic operating system, a text editor, and an assembler! This happened in 1995, when I was age 16.
TinyCompiler: A compiler in a week-end (ssloy.github.io)
Have you ever wondered how a compiler works, but you never found courage to find out? Then this series of articles is for you.
It is not a compiler error (2017) (plover.com)
No, it is not a compiler error. It is never a compiler error.
Parsing JSON in 500 lines of Rust (krish.gg)
Last semester at university, I took a course called "Syntax-Based Tools and Compilers". It focused on building a scanner, parser, compiler, and so on for a language called PL0. We used Python in the course, but I was really interested in learning Rust at the time.
RPython Compilation Quick Reference (tilde.town)
Well first things first, this is way more ram hungry than you'd expect, and you're restricted to python 2. BUT, you do end up with nice fast binaries at the end. So let's proceed!
Eigen Compiler Suite (openbrace.org)
Welcome to the official website of the Eigen Compiler Suite, a free and self-contained software development toolchain.
How do modern compilers choose which variables to put in registers? (stackexchange.com)
How do modern compilers choose which variables to put in registers?
Explaining my fast 6502 code generator (2023) (pubby.games)
To learn how optimizing compilers are made, I built one targeting the 6502 architecture. In a bizarre twist, my compiler generates faster code than GCC, LLVM, and every other compiler I compared it to.
Ways to generate SSA (bernsteinbear.com)
Static Single Assignment is a program representation where each “variable” (though this term can be misleading) is assigned exactly once. Mostly the variables aren’t variables at all, but instead names for values—for expressions. SSA is used a lot in compilers. I’m making this page to catalog the papers I have found interesting and leave a couple of comments on them.