Kant Generator X

Kant Generator Pro (by Mark Pilgrim) was a classic Mac program from the mid-1990s. The Kant Generator creates Kantian jibberish from combining simple rules. I found the source code online a couple of months ago and I have been porting it to Carbon with Mark's permission.

The first part of the development was updating the existing Classic code to be compiled on with the most recent Classic function names. This was relatively easy. The next step was the Carbon port.

A number of the unsupported functions were in the text editing and display sections of the code which weren't necessarily critical for the underlying implementation. I reduced the original code to the bare minimum. Following some heavy code porting from old TextEdit code, I found the Apple MLTE SDK which provides more relevant examples.

Update: 9 September 2005

I get occasional update request emails. Here is my response;

It's been about a year since I looked at the Kant Generator. Per the website, here's how the progress went;

(1) I migrated the circa 1992 code to run with the current classic APIs.

(2) I then looked at the unsupported functions that required Carbon-izing.

It turned out that most related to the text engine which needed to be entirely ported from TextEdit to MLTE. Here's where the problems started. There are really two parts to the Kant Generator;

(i) the text handling/editing API, and,
(ii) the replacement logic for the text generation.

In the original version they are pretty heavily intertwined which made resolving them into modular replaceable bits of code difficult.

(ii) has been maintained by the original author in Python;


(i) is non-trivial. Even the TextEdit version with speech etc took about 70%+ of the old code. So I thought it would be better to wrap the maintained Python in a Cocoa wrapper which gives you all the text API without a lot of API handling code. That's where the project came to a halt.

An additional note... If you want the Classic converted code for a Python/Cocoa port, I would recommend starting from the existing Python code. The Classic C code will not be of much help.

Back to Barbalet's Log