cd /news/developer-tools/micro-language-implementation-calciu… · home topics developer-tools article
[ARTICLE · art-108852] src=nedbatchelder.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Micro language implementation: Calcium

Ned Batchelder released Calcium, a 300-line language implementation on GitHub that demonstrates how Python-like languages are tokenized, parsed, compiled into bytecodes, and executed, aiming to clarify why Python is both interpreted and compiled.

read1 min views1 publishedAug 24, 2026

A tiny language, to explain how programming languages are implemented.

I wrote a tiny language implementation: Calcium. It’s meant as a demonstration of how languages like Python are implemented. It has a tokenizer, a parser, an AST, a compiler, bytecodes, and an execution engine, all in about 300 lines of code.

I did it because I often see the question: isn’t Python interpreted? Why do people say it’s compiled? (BTW, I also answered this in an earlier blog post: Is Python interpreted or compiled? Yes.) It can be hard to explain that your Python program never becomes an explicit sequence of native CPU instructions, which is what people often think “compiled” means.

So I coded up Calcium to have on hand the next time it comes up. I think it will help to be able to show the execution engine code reading bytecodes and doing what they say.

It could also be an interesting starting point for people wanting to play with a language implementation. It has almost nothing, so there’s lots of simple things (comments?) to add.

── more in #developer-tools 4 stories · sorted by recency
── more on @ned batchelder 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/micro-language-imple…] indexed:0 read:1min 2026-08-24 ·