# 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!