In Part 1, I explained why my Scheme interpreter, Schetoo, has the ability to fail or restart any instruction. In Part 2, I showed how it automatically checks that instructions do all necessary checks before they have any side effects. Those two posts described raising exceptions with longjmp, but didn’t really explain how the interpreter catches exceptions.
Posts Tagged ‘C’
Posted by kernelbob on January 4, 2011
Posted by kernelbob on January 3, 2011
Posted by kernelbob on January 2, 2011
In the first half of 2010, I wrote a Scheme interpreter which I called Schetoo. It is a sequel to an interpreter called kbscheme, which I worked on off-and-on in 2008 and 2009. Both are written in C.
I undertook these projects to learn more about Scheme, interpreters, and garbage collection. Along the way, I came up with an interesting technique to make interpreter implementation less error-prone. That’s what I want to write about today.
Posted by kernelbob on April 5, 2010
For a long time, C has let you write functions that take a variable number of arguments. But C leaves it up to each variadic function to figure out how many arguments it’s been passed, and up to each caller to pass the right arguments.
Here’s a cute hack to make variadic functions easier to write and a little harder to call incorrectly.
Posted by kernelbob on December 10, 2008
I’ve been writing C since 1981. I haven’t come up with a new idiom in a decade, until this morning.
Posted by kernelbob on October 25, 2008
Today I’ve released a new open source package: better-makefiles.
Makefiles are a black art. The vast majority of people who use ’em and write ’em don’t really understand what’s happening. I’ve spent a few hundred hours banging my head against them over the years. I decided yesterday morning to write a better makefile, one that would carry from project to project. I released it under a BSD license, in case someone else can benefit.
Update 15:30: I wrote a little more about it over here.