Jim Ingram's personal website. Mostly about programming.

Recent Posts

Building jlox with Gradle

I just started following along with Bob Nystrom’s Crafting Interpreters book a few days ago, and one of the first things I did was set up a Gradle project for the jlox interpreter. It’s a simple Java application with no external dependencies, so the build script is hardly interesting, except for one thing: starting in Chapter 5, there is a GenerateAst “script” needs to be run before compiling, because it generates source files. Read more...

A new home on the web

I’ve been a member of SDF Public Access UNIX System for around fifteen years, at the ARPA level for most of that time. They provide a great service, and have hosted various incarnations of my homepage since I first signed up. The most recent was started in November of 2014 as a blog about programming, built with Jekyll and only lasting for a couple of posts (which I have copied over to this site). Read more...

Unit tests for C, in two macros

No, not the same two macros as MinUnit. These macros have a few more features, and thus require a bit more from the runtime. Together, the two macros are used to define test functions that run code in a new process, and that have consistent return values to indicate whether the test succeeded, failed, or had an error. All of the code in this post is available on GitHub, under the terms of the MIT License. Read more...

A Makefile template for simple C projects

Large programming projects may require elaborate build systems, but for a simple project consisting of a single executable target and handful of C source files, a single Makefile is often all that is necessary. If you use GNU Make and a C compiler capable of emitting dependency rules (both GCC and Clang can do this, and no doubt others can as well), then a single generic Makefile template can be used for multiple projects by changing only a few variable definitions. Read more...