4 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
This article surveys different options for compiler backends, including machine code, intermediate representations like LLVM, and high-level languages such as C and JavaScript. It also touches on virtual machines, WebAssembly, and unconventional targets like Brainfuck and lambda calculus. The author aims to help amateur compiler developers navigate their choices.
If you do, here's more
Choosing a compiler target is a significant decision for developers, especially with the variety of options available today. In the past, targeting specific machine architectures meant dealing directly with their instruction sets. Now, many compilers use Intermediate Representations (IR) to simplify this process. LLVM is a leading choice, offering a robust library for generating machine code across architectures like x86-64 and ARM64. Alternatives like GCC and Cranelift exist, but minimalist options like QBE and libFIRM cater to those prioritizing simplicity and speed.
Some developers opt to transpile code into high-level languages like C or JavaScript. Compiling to C enhances portability since C compilers are widespread, a tactic used by languages like Chicken Scheme. JavaScript remains a dominant target for web applications, supported by languages such as TypeScript and Dart. Lua is another lightweight language for transpilation. For those seeking a different approach, targeting Lisp dialects like Chez Scheme allows for using advanced features like macros.
Virtual machines (VMs) are also popular, where languages compile to bytecode for execution on platforms like the Java Virtual Machine (JVM) or the BEAM VM for Erlang. WebAssembly (Wasm) represents a modern option, designed for security and efficiency, compatible across major browsers. Emerging frameworks like PyPy and GraalVM provide tools for building custom JIT compilers. For the adventurous, unconventional targets like Brainfuck and lambda calculus offer unique challenges and insights into computation. There's a rich landscape of possibilities for compiler developers, each choice influencing performance, compatibility, and complexity.
Questions about this article
No questions yet.