#siraben has taken my term-rewriting language #Qfitzah and seems to have gotten it to bootstrap a #C compiler. #bootstrappable #compilers
on 02026-09-02“The #egg-project uses #e-graphs to provide a new way to build program optimizers and synthesizers. An e-graph compactly represents many equivalent programs. These four e-graphs represent more and more (even infinite!) ways to write (a × 2) / 2. egg makes e-graphs fast and flexible enough for use in program optimization and synthesis.” #compilers
on 02026-08-19#stage0 #C compiler in #asm. #compilers
on 02026-05-20#AI is writing C #compilers at #Anthropic #toread
on 02026-02-09Norman Ramsey’s C-- ("C minus minus"), a #C subset designed as a targer for #compilers
on 02026-02-09Wingo on using #C as a target for #compilers #toread
on 02026-02-09#Godbolt on the inlining optimization in #compilers.
on 02026-01-15Complaints about using #LLVM to write #compilers.
on 02026-01-12#AZHenley #tutorial on #compilers in Python. #toread
on 02025-12-31people arguing about how to build #compilers
on 02025-11-25How Kristopher Micinski thinks you should write #compilers, structured as a five-project #tutorial
on 02025-11-25another copy of the #paper “Single-Pass Generation of Static Single Assignment Form for Structured Languages” #SSA #compilers #toread
on 02025-11-11#paper: “Single-Pass Generation of Static Single Assignment Form for Structured Languages” #SSA #compilers #toread
on 02025-11-11Control-flow graph visualization (CFG) for #compilers.
on 02025-10-29explanation of #Fil-C #C #compilers for #security
on 02025-10-28#compilers #SSA explanation with block arguments. #toread
on 02025-10-22really interesting discussion of #WASM, including stuff by Mariano Guerra on #compilers
on 02025-09-28Scm2wasm: A #Scheme to #WASM compiler in 600 lines of C, making use of WASM GC #compilers #toread. wasmtime -Wgc --invoke start output.wasm
how #register-allocation works in #Golang #compilers #toread
on 02025-08-27#Tekknolagi on linear-scan #register-allocation #compilers #toread (I’ve read it once but not the code)
on 02025-08-27why #JIT #compilers don’t get good #performance out of #Python
on 02025-08-06#video of Jon #Blow’s presentation at Reboot Develop in 02017 about designing #Jai for #videogames. Photoshop takes 7 seconds to start up to display you an image, during which time it’s displaying you a high-resolution image on its splash screen that isn’t the one you wanted to see, and “now” in 02017 opening the File→New menu window takes an entire second. (Indeed, in this 30fps video, it takes 30 frames to finish drawing the menu.) On his i7-7700HQ. He says single-core performance had improved 24× since 02000 based on SPECfp, but it’s also quad-core. Demo of his in-progress Sokoban game, started a year earlier at the same time as Jai, starts at 16'36". Roughly 100kloc per second unoptimized compilation speed on the i7-7700HQ. A thing I hadn’t realized before is that his compile-time execution represents a repudiation of the idea of simple DSLs like the shell, which is consistent with his dislike of things like Lua. The video is unfortunately very hard to read his screen from. This is one of the videos where he says that the syntax is temporary. His reflection system is useful for not just compile-time computation but also run-time debug messages and experimental interfaces. He never mentions the name of the language, so maybe he hadn’t settled on “Jai” yet, but the compiler is already called “jai.exe” and the filenames end in “.jai”. Also he already had the #LLVM backend, which he described as the “short-term plan” for optimization. #compilers
on 02025-08-03Notes on working through Nora Sandler’s introductory book on writing C #compilers.
on 02025-07-20Nora Sandler wrote a #compilers #tutorial in 02017 working through writing a C compiler. At some point she made it a No Starch book. #toread
on 02025-07-20"XD Pascal": 10kloc #Pascal compiler, “[Golang]-style methods and interfaces”, 2-clause BSD license, but without OO or separate compilation. #small-is-beautiful #compilers
on 02025-06-17TMS320C3x #C #compilers user’s guide #PDF says, on p. 3-4 (p. 101/301): “All integer types (char, short, int, long, and their unsigned counterparts) are equivalent types and are represented as 32-bit binary values.”
on 02025-06-12#LLVM supports the TI-84+ CE calculator now, which has 256KiB of RAM, and ocamlcc can compile #OCaml to C, and js_of_ocaml compiles it to JS. Farlow wrote a new c_of_ocaml backend for js_of_ocaml. But he doesn’t have floats or exceptions working yet. #compilers
Daniel Berlin commenting on Dan Bernstein’s talk on the death of optimizing #compilers, and people rebutting his more dubious claims about how great compilers are
on 02025-05-20Mike Pall’s HN comments, mostly on #LuaJIT and #compilers.
on 02025-05-16#gvwilson’s #review of #Appel’s #compilers book: “this is one of the first compiler texts I have seen that presents, at an undergraduate level, developments from the mid-1980s onward. There are chapters on lexing, parsing, and abstract syntax, but there are also chapters on basic blocks and traces, instruction selection algorithms, liveness analysis, and register allocation (a topic that wasn’t even in the index of the text I used 15 years ago). This breakdown of topics is a good reflection of where a compiler writer’s time actually goes. Most books, on the other hand, tend to concentrate on what we already understand (57 flavors of parsing) rather than what we actually do.”
on 02024-12-21#PDF slides for Dan Bernstein’s talk “The Death of Optimizing #Compilers”. #DJB
on 02024-12-17#Compilers #paper #PDF from 01978 by Cattell on automatic optimal instruction selection, introducing Maximal Munch
on 02024-12-13Discussion of #Baziotis article on misconceptions about #compilers.
on 02024-12-12#paper on "goSLP", which uses linear #optimization (ILP) for #SIMD #vectorization, achieving significant #performance gains on floating-point benchmarks like SPEC2017fp. “Using an integer linear programming (ILP) solver, goSLP searches the entire space of statement packing opportunities for a whole function at a time, while limiting total compilation time to a few minutes. Furthermore, goSLP optimally solves the vector permutation selection problem using dynamic programming.” #compilers
on 02024-12-12#Compilers in #Greek are “Μεταγλωττιστής” (well, that’s the singular) or “μεταφραστής”
on 02024-12-12#Baziotis bachelor’s #dissertation #paper on #compilers: “Designing Decoupled Compiler Transformation APIs/Σχεδιάζοντας Αποσυνδεδεμένες Διεπαφές για Μετασχηματισμούς Μεταγλωττιστών”
on 02024-12-12#Baziotis on intermediate representations in #compilers and how really target-independent they are. #toread
on 02024-12-12#compilers for #Pandas to get 1000× better #performance on #exploratory-data-analysis: "Dias" by #Baziotis
on 02024-12-12using #machine-learning and #neural-networks to generate cost models for #compilers targeting #tensor-processing-units #PDF #paper
on 02024-12-12Should #compilers define all #undefined-behavior? #toread #Baziotis
on 02024-12-12#compilers sometimes can’t apply certain optimizations because they would invoke #undefined-behavior, for example hoisting a constant expression out of a loop that might execute zero times. #toread #Baziotis
on 02024-12-12“DMD is the reference compiler for the #D programming language.” Baziotis recommends studying it. #compilers
on 02024-12-12#LDC is the #LLVM based #D compiler which Baziotis recommends studying. “The compiler uses the official DMD frontend to support the latest version of D2, and relies on the LLVM Core libraries for code generation.” #compilers
on 02024-12-12“A fast algorithm for finding dominators in a flowgraph is presented. The algorithm uses depth-first search and an efficient method of computing functions defined on paths in trees.” The Lengauer–Tarjan algorithm #paper from 01979. #toread #compilers #graphs #algorithms “A vertex v dominates another vertex w≠v in G if every path from [the start vertex] r to w contains v.”
on 02024-12-12“Dominance is one of the most ubiquitous concepts in #compilers. By far the most popular algorithm for discovering dominance relationships is the Lengauer-Tarjan algorithm - a fascinating but scary piece of genius. In this article, we will deconstruct its most important part, the computation of semidominators. To tackle it, I’ll use a lot of intuition, crappy drawings and some imagination.” #toread #algorithms #Baziotis
on 02024-12-12common misconceptions about #compilers: “Optimization gives us optimal programs”, “Branch weights and the CPU’s branch predictor”, “-O3 produces much faster code than -O2”, “Javascript interpreters JIT at runtime because they don’t know which paths are hot ahead of time”, “If you have a compiler, you don’t need an interpreter”, “The middle-end is target/platform-independent”, “The compiler optimizes for data locality”, “-O0 gives you fast compilation”, “Templates are slow to compile”, “Separate compilation is always worth it”, “Why does link-time optimization (LTO) happen at link-time?”, “Inlining is useful primarily because it eliminates a call instruction”, “The role of the inline keyword”, “The best production compiler to study is LLVM”, “Undefined behavior only enables optimizations”, “The compiler can “simply” define undefined behavior”, “99% correctness rate is ok”. All of these are false except for the ones that aren’t falsifiable. #Baziotis recommends studying the Golang compiler, LDC, and Digital Mars #D.
on 02024-12-12The old Zortech C and C++ #compilers for #MS-DOS #retrocomputing (but not free software). This is potentially interesting because of memory handle support.
on 02024-11-28SML/NJ seems to still be alive, using #LLVM these days. #ML #compilers
on 02024-11-28Scraping callstack information out of #LuaJIT for #eBPF #profilers. #Lua #compilers #toread
on 02024-11-22An #SECD machine to play with, including #compilers for #Lisp, etc.
on 02024-08-25#PDF #paper on a new intermediate representation for #compilers called RVSDG, Regionalized Value State Dependence Graph.
on 02024-01-12the chapter of #Crenshaw’s #compilers #tutorial on expression parsing, with example code in Pascal to emit 68000 code, describing a simple register-allocation approach near the end, though without example code for that
on 02023-10-22oh, I didn’t know #tree-sitter was a #GLR parser. #compilers
on 02023-10-21to flush the instruction cache for #RTCG JIT #compilers on #ARM #Linux you need to make sure the memory is mapped with PROT_EXEC before you invoke sys_cacheflush or __clear_cache(). #hardware
#RTCG #hardware cache flush instructions on #ARM 64 #hardware for JIT #compilers
on 02023-09-19#RTCG #hardware cache flush instructions for JIT #compilers on Cell and ARM.
on 02023-09-19The 01995 #book on "lcc", the #C compiler, written by then-Princeton-prof David R. Hanson and Bell Labs Technical Staff member Chris Hanson. #compilers
on 02023-09-04A 9600-line-of-code #C compiler by Rui Ueyama, the original author of LLVM’s lld. No idea how much RAM it needs to run. #compilers
on 02023-09-04A public database of test cases for #C #compilers.
on 02023-09-04A #C compiler in 500 lines of Python, targeting #wasm, whose breaks made implementing for “extremely cursed”. Implements arithmetic, precedence, int, short, char, string constants, pointers, simple arrays, functions, and typedefs, but not structs, the preprocessor, or casts. #small-is-beautiful #compilers
Cliff Click’s #PDF dissertation #paper on optimizing #compilers from 01995, which #moon-child says is the basis for HotSpot.
on 02023-09-02a sketch of #compilers with #type-inference
on 02023-07-04a toy programming language article that 94 people liked. in Python, called “my”, pop infix syntax with shift-reduce precedence parsing, but no control structures or subroutines. #compilers
on 02023-07-02a C compiler compiled into the λ-calculus. #bootstrapping #compilers
on 02022-10-12more notes on #register-allocation in #compilers
on 02022-10-12#register-allocation by reverse linear scan for #compilers
on 02022-10-12#LuaJIT intellectual property disclosures from 02009 #compilers
on 02022-10-12rebuttal to some criticisms of #wasm as ill-suited to streaming #compilers
on 02022-10-12Jack Crenshaw’s “Let’s Make a Compiler” #compilers
on 02021-03-02Maxine’s JS #JIT. #compilers
on 02019-02-12An index of #LuaJIT implementation notes by Mike Pall, and a link to Maxine’s Higgs work on JS #JIT. #compilers
on 02019-02-12the internals of SpiderMonkey. #JS #compilers
on 02018-10-05#LLVM #compilers optimization problems related to linking.
on 02017-11-25The #Racket implementation of the #nanopass #compilers idea.
on 02017-11-25Lindsey Kuper on Kent Dybvig’s "nanopass" #compilers course, explaining why saying “transpiler” is harmful.
on 02017-11-25Laurie Tratt on optimizing #compilers and why they’re still useful
on 02017-07-01#C #compilers bugs on objects bigger than PTRDIFF_MAX
on 02017-03-11#PDF of Tanenbaum (et al)’s 1983 #paper on “a machine architecture for use with block-structured languages” called EM; really more of an UNCOL than a machine #ISA. #compilers #toread
on 02017-03-11#C in 4 functions in like 527 LoC (with a stack bytecode interpreter) #smallisbeautiful #compilers #toread
on 02017-03-11#video of Aaron Hsu talking about #compilers for two hours. #Co-dfns #GPGPU #APL
on 02017-03-07Aaron Hsu’s #paper on #GPGPU #APL #compilers, “The key to a data-parallel compiler” #Co-dfns
on 02017-03-07discussion thread on (and mostly by) Aaron Hsu (arcfide) and his #GPGPU #APL compiler "Co-dfns". #compilers
on 02017-03-07Aaron Hsu and his team have written a 750-line #APL compiler for #GPGPU, in itself apparently, in six years. #compilers #Co-dfns
on 02017-03-07"Crafting Interpreters", munificent’s in-progress #ebook on writing #interpreters (and maybe #compilers too)
on 02017-01-16#C #compilers sometimes don’t respect termination behavior of programs, turning infinite loops into no-ops
on 02016-10-06blog post about #C declarator syntax and type systems in #compilers
on 02016-09-23"Graal" is a proprietary optimizing compiler or toolkit for making #compilers by #partial-evaluation of AST interpreters written using a proprietary interpreter toolkit called "Truffle" (i.e. the first of the three projections of Dr. Futamura.) “Ruby programs get 400% faster than the best alternative runtime.” By Mike Hearn, the ragequitting Bitcoin hacker.
on 02016-07-24gpucc, an LLVM-based, fully open-source, CUDA-compatible compiler for high #performance computing #GPGPU #compilers (but they still rely on NVIDIA’s backend compiler to the actual undocumented GPU instruction set)
on 02016-04-25this collection of #compilers stuff for Python includes several different things that take the “compile array expressions into high-#performance code” approach: Numba, Theano, Parakeet, and Copperhead.
on 02016-04-22A new #PyPy release with significant #performance improvements. Also they now support five architectures: i386, amd64, ARM (32-bit), PowerPC 64, and IBM System/360 (s390x), and they now have basic numpy support instead of none. #python #compilers
on 02016-04-21#pdf #paper on optimizing #compilers: “The fastest known algorithms for 0CFA, the least expensive of the popular kCFA family of analyses, run in cubic time... A less precise form of control-flow analysis, sub-0CFA, runs in linear time, but is also not flow-sensitive. This paper presents a flow-sensitive sub-0CFA algorithm that runs in linear-log time.”
on 02016-01-12#Rust is getting contaminated with undefined behavior via #LLVM. #compilers
on 02015-12-31C in four functions: a self-interpreting interpreter for a subset of C in 10 pages of code, compiling to a stack-based bytecode. #compilers #smallisbeautiful
on 02015-12-29Rui Ueyama wrote a #bootstrapping #C compiler in 5000 lines of code in 40 days. Starts with a run-time stack machine and single-level parser directly emitting code, later separated into a more conventional tokenizer-parser-generator structure. Supporting standard ABIs. After 29 days it was able to partly self-compile, after 37 days it incorrectly thought it could compile itself, and after 40 days it was self-hosting. #compilers
on 02015-12-14“the death of optimizing #compilers” #djb
on 02015-12-03Edgar Aroutiounian wrote a compiler from #OCaml to #JS for node.js. #compilers
on 02015-12-03a presentation of a compiler that emits code along with its proof in #Agda, which I guess is a sort of proof assistant? With live Agda code in a page. #formal-methods #compilers
on 02015-11-16A compiler for #Brainfuck that does reasonable levels of optimizations, kind of like the “fixtures” of #Urbit’s Nock. #compilers
on 02015-09-05“Growing a Compiler”, on a language and #virtual-machine called GEM, with the first version of the compiler written in Matlab. #compilers
on 02015-08-14using #formal-methods to verify #C #compilers and carry through proofs of your #verifiable-c programs through to the #asm using separation logic. Appel, Leroy, and some others.
on 02015-08-06the separately-compiled lambda calculus #compilers
on 02015-08-05