User

nedbat

Profile checked
27 Aug 2026
Feed refreshed
27 Aug 2026

Recent

Posts from discovered feeds

22 Aug 2026 · Ned Batchelder's blog

Micro language implementation: Calcium

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 nev…

9 Aug 2026 · Ned Batchelder's blog

Caller-specific coverage

I’ve had an idea rattling around to get more detail from coverage measurement. Can we measure the coverage in a function separately for each caller of the function? Here’s why I want it: in Acidica , my toy BASIC interpreter, I had code to implement the built-in functions that looked something like this: match func_name : case "LEN" : if len ( args ) != 1 : raise TypeError ( f "Wrong arguments for LEN, got { len ( args ) } " ) return len ( args [ 0 ]) case "LEFT$" : if len ( args ) != 2 : ra…

26 Jul 2026 · Ned Batchelder's blog

Acidica

My latest fun project is a BASIC interpreter called Acidica . Classic BASIC is an old-school language first developed in 1964 that saw an explosion of implementations on microcomputers in the ‘70s and ‘80s. It’s much more primitive than the Visual Basic that you might be familiar with. A simple BASIC program: 10 INPUT "What is your name" ; U$ 20 PRINT "Hello " ; U$ 30 INPUT "How many stars do you want" ; N 40 S$ = "" 50 FOR I = 1 TO N 60 S$ = S$ + "*" 70 NEXT I 80 PRINT S$ 90 INPUT "Do you…