# writing-compiler

Published articles for writing-compiler.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Generating Java bytecode: Write yourself a compiler, Part V

DevFeed: [Generating Java bytecode: Write yourself a compiler, Part V](<https://devfeed.tech/articles/generating-java-bytecode-write-yourself-a-compiler-part-v-38041.md>)

Original publisher: [Read original article](<https://nurkiewicz.com/2026/09/generating-java-bytecode-write-yourself-a-compiler.html>)

Published: 2026-09-14T22:00:00Z

Content type: tutorial

Language: en

Sources: [Tomasz Nurkiewicz around Java and concurrency](<https://devfeed.tech/sources/tomasz-nurkiewicz-around-java-and-concurrency.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [bytecode](<https://devfeed.tech/tags/bytecode.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [file](<https://devfeed.tech/tags/file.md>), [go](<https://devfeed.tech/tags/go.md>), [interpreter](<https://devfeed.tech/tags/interpreter.md>), [java](<https://devfeed.tech/tags/java.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [virtual-machine](<https://devfeed.tech/tags/virtual-machine.md>), [writing-compiler](<https://devfeed.tech/tags/writing-compiler.md>)

### AI overview

This tutorial explains how to extend a toy-language compiler to emit valid JVM bytecode in a .class file that can run on the Java Virtual Machine. It introduces JVM instruction families for pushing integer values and explains how the constant pool stores constants and symbolic references for reuse.

### Source excerpt

Last time we created a virtual machine for our toy language. I think you can agree that designing a language which barely recognizes expressions like 2 + 3w and building a brand-new virtual machine for it seems a bit tedious. So what about keeping our microscopic language for now, but running it on a real, production-ready, battle-proven virtual machine? Like the Java Virtual Machine? Our task for today is to emit JVM bytecode in the form of a valid .class file. That file can then be fed directly to the JVM to run our program.

## Your First Virtual Machine: Write yourself a compiler, Part IV

DevFeed: [Your First Virtual Machine: Write yourself a compiler, Part IV](<https://devfeed.tech/articles/your-first-virtual-machine-write-yourself-a-compiler-part-iv-38040.md>)

Original publisher: [Read original article](<https://nurkiewicz.com/2026/08/your-first-virtual-machine-write-yourself-a-compiler.html>)

Published: 2026-08-24T22:00:00Z

Content type: tutorial

Language: en

Sources: [Tomasz Nurkiewicz around Java and concurrency](<https://devfeed.tech/sources/tomasz-nurkiewicz-around-java-and-concurrency.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Programming language](<https://devfeed.tech/topics/programming-language.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>)

Tags: [arithmetic](<https://devfeed.tech/tags/arithmetic.md>), [bytecode](<https://devfeed.tech/tags/bytecode.md>), [clojure](<https://devfeed.tech/tags/clojure.md>), [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [feature](<https://devfeed.tech/tags/feature.md>), [go](<https://devfeed.tech/tags/go.md>), [interpreter](<https://devfeed.tech/tags/interpreter.md>), [reverse-polish-notation](<https://devfeed.tech/tags/reverse-polish-notation.md>), [stack](<https://devfeed.tech/tags/stack.md>), [virtual-machine](<https://devfeed.tech/tags/virtual-machine.md>), [vm](<https://devfeed.tech/tags/vm.md>), [writing-compiler](<https://devfeed.tech/tags/writing-compiler.md>)

### AI overview

This tutorial explains how to build a virtual machine that reads and executes a binary intermediate representation. It covers the instruction loop, operand stack, arithmetic operations, postfix notation, and how the resulting executable compares with JVM files and .NET assemblies.

### Source excerpt

In the previous article, we emitted an intermediate representation (IR) for our programming language that is easier to process than source code. However, we did not build a program that could read and execute that IR. Such a program is called a virtual machine. Technically, it's still an interpreter. But instead of interpreting source code, it interprets IR. Our IR is binary, compact, structured, and generally faster to interpret than the original source. Moreover, as you'll see later, the VM's instruction set can express programs that our source language cannot produce yet!

## Compiling to intermediate representation: Write yourself a compiler, Part III

DevFeed: [Compiling to intermediate representation: Write yourself a compiler, Part III](<https://devfeed.tech/articles/compiling-to-intermediate-representation-write-yourself-a-compiler-part-iii-38039.md>)

Original publisher: [Read original article](<https://nurkiewicz.com/2026/08/compiling-to-intermediate-representation-write-yourself-a-compiler.html>)

Published: 2026-08-16T22:00:00Z

Content type: tutorial

Language: en

Sources: [Tomasz Nurkiewicz around Java and concurrency](<https://devfeed.tech/sources/tomasz-nurkiewicz-around-java-and-concurrency.md>)

Topics: [Compiler](<https://devfeed.tech/topics/compiler.md>), [virtual machines](<https://devfeed.tech/topics/virtual-machines.md>), [Code](<https://devfeed.tech/topics/code.md>), [WebAssembly](<https://devfeed.tech/topics/web-assembly.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [assembly](<https://devfeed.tech/tags/assembly.md>), [bytecode](<https://devfeed.tech/tags/bytecode.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [go](<https://devfeed.tech/tags/go.md>), [interpreter](<https://devfeed.tech/tags/interpreter.md>), [ir](<https://devfeed.tech/tags/ir.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [python](<https://devfeed.tech/tags/python.md>), [virtual-machines](<https://devfeed.tech/tags/virtual-machines.md>), [webassembly](<https://devfeed.tech/tags/webassembly.md>), [writing-compiler](<https://devfeed.tech/tags/writing-compiler.md>)

### AI overview

This tutorial explains how a small interpreter project evolves into a compiler by emitting intermediate representation (IR). It contrasts interpreted and compiled languages, describes bytecode and virtual machines, and uses Java and WebAssembly examples to show how IR instructions are executed.

### Source excerpt

It's time to dive a bit deeper and abandon the naive realm of interpreters. Our tiny little project can finally call itself a compiler. In this part we'll emit so-called intermediate representation instead of just evaluating and running the source code as-is. OK, what does this all mean?

## Arithmetic interpreter: Write yourself a compiler, Part II

DevFeed: [Arithmetic interpreter: Write yourself a compiler, Part II](<https://devfeed.tech/articles/arithmetic-interpreter-write-yourself-a-compiler-part-ii-38036.md>)

Original publisher: [Read original article](<https://nurkiewicz.com/2026/07/arithmetic-interpreter-write-yourself-a-compiler.html>)

Published: 2026-07-21T22:00:00Z

Content type: tutorial

Language: en

Sources: [Tomasz Nurkiewicz around Java and concurrency](<https://devfeed.tech/sources/tomasz-nurkiewicz-around-java-and-concurrency.md>)

Topics: [Compiler](<https://devfeed.tech/topics/compiler.md>), [Programming language](<https://devfeed.tech/topics/programming-language.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Regular expression](<https://devfeed.tech/topics/regular-expression.md>)

Tags: [arithmetic](<https://devfeed.tech/tags/arithmetic.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [go](<https://devfeed.tech/tags/go.md>), [intermediate](<https://devfeed.tech/tags/intermediate.md>), [interpreter](<https://devfeed.tech/tags/interpreter.md>), [operations](<https://devfeed.tech/tags/operations.md>), [programming-language](<https://devfeed.tech/tags/programming-language.md>), [writing-compiler](<https://devfeed.tech/tags/writing-compiler.md>)

### AI overview

This tutorial extends a simple arithmetic interpreter to support addition, subtraction, multiplication, and division. It updates the regular-expression parsing and interpreter logic, with a later installment planned to compile the language into an intermediate representation.

### Source excerpt

In the previous article, we created the most naive interpreter, which can basically execute number + number expressions. A logical extension is obviously to handle all basic operations: addition, subtraction, multiplication and division. The time has come!

## The simplest interpreter: Write yourself a compiler, Part I

DevFeed: [The simplest interpreter: Write yourself a compiler, Part I](<https://devfeed.tech/articles/the-simplest-interpreter-write-yourself-a-compiler-part-i-38038.md>)

Original publisher: [Read original article](<https://nurkiewicz.com/2026/07/simplest-interpreter-write-yourself-a-compiler-part-i.html>)

Published: 2026-07-16T22:00:00Z

Content type: tutorial

Language: en

Sources: [Tomasz Nurkiewicz around Java and concurrency](<https://devfeed.tech/sources/tomasz-nurkiewicz-around-java-and-concurrency.md>)

Topics: [Compiler](<https://devfeed.tech/topics/compiler.md>), [Parser](<https://devfeed.tech/topics/parser.md>), [Parsing](<https://devfeed.tech/topics/parsing.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [go](<https://devfeed.tech/tags/go.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [interpreter](<https://devfeed.tech/tags/interpreter.md>), [lexer](<https://devfeed.tech/tags/lexer.md>), [writing-compiler](<https://devfeed.tech/tags/writing-compiler.md>)

### AI overview

This tutorial begins a series on building a compiler by implementing a simple interpreter in Go. The interpreter lexes and evaluates an input expression containing the addition of two numbers, using a regular expression to validate the structure and extract tokens.

### Source excerpt

I've always felt that writing a compiler is the most romantic software engineering task. You're writing a program that reads textual instructions describing precisely what a computer should do. Do not confuse this with prompting an LLM, where you write vague, verbose instructions that only loosely describe what a computer might do. But I digress.