Bobbing for Kernels

See Bob. See Bob bob. Bob, Bob, bob!

Posts Tagged ‘C’

A Safer Scheme Interpreter, Part 3

Posted by kernelbob on January 4, 2011

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.

Read the rest of this entry »

Advertisements

Posted in Scheme | Tagged: , , , , , , , | Leave a Comment »

A Safer Scheme Interpreter, Part 2

Posted by kernelbob on January 3, 2011

In my last post, I promised to explain how my Scheme interpreter, Schetoo, can automatically verify that its instructions are restartable.  But first, some background.

Read the rest of this entry »

Posted in Scheme | Tagged: , , , , , , , | 1 Comment »

A Safer Scheme Interpreter

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.

You can see them both on github.

https://github.com/kbob/kbscheme
https://github.com/kbob/schetoo

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.

Read the rest of this entry »

Posted in Scheme | Tagged: , , , , , , , , | 3 Comments »

Variadic functions in C: a new idiom?

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.

Read the rest of this entry »

Posted in C | Tagged: , , , | 5 Comments »

A new C idiom

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.

Read the rest of this entry »

Posted in computers, languages | Tagged: , , , | 2 Comments »

Better Makefiles

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.

Read the rest of this entry »

Posted in computers | Tagged: , , , , | Leave a Comment »