Why ML/OCaml are good for writing compilers (1998)(cs.yale.edu) Let's use the term "ML" to mean SML or Objective Caml. I'm a devotee of Ocaml, but I have SML/NJ installed and although I prefer the distribution, tools and overall implementation of Ocaml, I'd be happy to write in SML/NJ if Ocaml wasn't around.
Writing that changed how I think about programming languages(bernsteinbear.com) Every so often I come across a paper, blog post, or (occasionally) video that completely changes how I think about a topic in programming languages and compilers. For some of these posts, I can’t even remember how I thought about the idea before reading it—it was that impactful.
A whippet waypoint / Nofl: A Precise Immix(wingolog.org) Hey peoples! Tonight, some meta-words. As you know I am fascinated by compilers and language implementations, and I just want to know all the things and implement all the fun stuff: intermediate representations, flow-sensitive source-to-source optimization passes, register allocation, instruction selection, garbage collection, all of that.
Driving Compilers (2023)(fabiensanglard.net) This series is divided into five parts. First is explained the component which rules them all, the compiler driver (1). Then we drill into the three stages of the compilation pipeline, detailing their inputs/outputs. The pre-processor (2), cpp, converts source code files into translation units (TU), is covered first. Then comes the compiler cc (3), which ingests TUs and outputs relocatable (object) files. Then we look at the element combining all objects together into and executable, the linker ld (4).
C++26: more constexpr in the standard library(sandordargo.com) Last week, we discussed language features that are becoming constexpr in C++26. Today, let’s turn our attention to the standard library features that will soon be usable at compile time. One topic is missing: exceptions. As they need both core language and library changes, I thought they deserved their own post.
Some __nonstring__ Turbulence(lwn.net) New compiler releases often bring with them new warnings; those warnings are usually welcome, since they help developers find problems before they turn into nasty bugs. Adapting to new warnings can also create disruption in the development process, though, especially when an important developer upgrades to a new compiler at an unfortunate time. This is just the scenario that played out with the 6.15-rc3 kernel release and the implementation of -Wunterminated-string-initialization in GCC 15.
C++26: more constexpr in the core language(sandordargo.com) Since constexpr was added to the language in C++11, its scope has been gradually expanded. In the beginning, we couldn’t even use if, else or loops, which were changed in C++14. C++17 added support for constexpr lambdas. C++20 added the ability to use allocation and use std::vector and std::string in constant expressions. In this article, let’s see how constexpr evolves with C++26. To be more punctual, let’s see what language features become more constexpr-friendly.
Pydrofoil: Accelerating Sail-based instruction set simulators(arxiv.org) We present Pydrofoil, a multi-stage compiler that generates instruction set simulators (ISSs) from processor instruction set architectures (ISAs) expressed in the high-level, verification-oriented ISA specification language Sail.
Things Zig comptime won't do(matklad.github.io) Zig’s comptime feature is most famous for what it can do: generics!, conditional compilation!, subtyping!, serialization!, ORM! That’s fascinating, but, to be fair, there’s a bunch of languages with quite powerful compile time evaluation capabilities that can do equivalent things. What I find more interesting is that Zig comptime is actually quite restrictive, by design, and won’t do many things! It manages to be very expressive despite being pretty limited. Let’s see!
466 points by JadedBlueEyes 48 days ago | 243 comments
Bootstrapping Rustc from Source(github.com/dtolnay) This repo contains a minimal reliable setup for compiling the most recent stable Rust compiler from source on Linux i.e. without downloading any already compiled Rust binaries from the internet.
Things Zig Comptime Won't Do(matklad.github.io) Zig’s comptime feature is most famous for what it can do: generics!, conditional compilation!, subtyping!, serialization!, ORM! That’s fascinating, but, to be fair, there’s a bunch of languages with quite powerful compile time evaluation capabilities that can do equivalent things. What I find more interesting is that Zig comptime is actually quite restrictive, by design, and won’t do many things! It manages to be very expressive despite being pretty limited. Let’s see!
Ask HN: Writing an Interpreter in Go or Crafting Interpreters?(ycombinator.com) I'm thinking of learning about compilers and am pleased to find that there seems to be at least two very accessible choices, "Writing An Interpreter In Go" and Crafting Interpreters. Curious if folks here have experience with either and could provide recommendations?
What the hell is a target triple?(mcyoung.xyz) Cross-compiling is taking a computer program and compiling it for a machine that isn’t the one hosting the compilation. Although historically compilers would only compile for the host machine, this is considered an anachronism: all serious native compilers are now cross-compilers.
13 points by todsacerdoti 59 days ago | 0 comments
Vishap Oberon Compiler(github.com/vishapoberon) Ѵishap Oberon is a free and open source (GPLv3) implementation of the Oberon-2 language and libraries for use on conventional operating systems such as Linux, BSD, Android, Mac and Windows.
Compilers: Incrementally and Extensibly (2024)(okmij.org) Compilers is a practical course. Its goal is to build a real compiler, which compiles a high-level language down to the actual x86-64 machine code and produces an executable that runs on student's laptops.