Older blog entries for emk (starting at number 8)

13 Sep 2000 (updated 6 Jan 2001 at 23:58 UTC) »

[ Ranting about the Client From Hell snipped. ]

12 Sep 2000 (updated 17 Jan 2001 at 18:58 UTC) »

CustomDNS: OK, it's time to finally fix the authentication system. The problem: the CustomDNS authenticator wants to use its own database tables, not my customer's. The solution: fix CustomDNS to load the relevant SQL queries from the configuration file.

*hack hack hack* Score! It runs! One more billable feature. :-)

Language hacking: I cornered the new professor last night, and asked him to act as faculty advisor for my project. We had a great talk about multimethod dispatch, efficient bounds-checking, whether scripting languages can be compiled, and other groovy stuff like that.

I hope I didn't scare the poor professor away. :-( I can be a bit too talkative, as several people have pointed out.

Accounts receivable: It's that time of month again. Sample conversation: "Hello! Did you ever get my bill? Great! It's been almost thirty days, hasn't it? Oh, thank you. Have a great day!"

There's another version of this conversation. It occurs on a daily basis past the 40 day mark, and it starts to involve other people.

CustomDNS: Lots of new features! The update server is now more modular, and you can add custom extensions. All the SysV init scripts and daemonizaton wrappers just got smarter, too.

Once I clean up the documentation and make some RPMs, I should probably release 0.5.

Language hacking: Hmpf. Designing a language is easy. Designing a good language is hard. You've got to look at each feature, and throw out the ones which don't do enough. But things are going well--the interpreter core is finally starting to shape up.

I hope to turn my language into a research project, and get some academic credit. :-) I'm going to track some professors down later this week. Here's my pitch: "I'm interestred in compilable, extensible scripting languages. There are these really neat papers by..."

Personal: Once my current consulting project is over, I'm going to buy myself some lego Mindstorms as a reward. ;-)

Work: Ah, I'm back among the living. I was under the weather for a while, and I spent the last few weeks as a complete space cadet. Let's see if I can get caught up today, and spend a guilt-free evening with my girlfriend.

MFTL: I spent a few minutes last night setting up a private ZWiki to hold my lanuage design notes. If I can get a cheap co-lo this week, I'll make the wiki public.

Wikis (of any sort) make good design tools. But ZWiki also provides a great bonus: page hiearchies which still posses the Wiki nature. So I can sort all my language notes into categories and keep track of where I am.


My client is looking to hire a server-side Java guy. Through a freak co-incidence, one of the candidates is not only familiar with one of the libraries we're using, but was also the library's first major user. Score!

The candidate is also an open source developer, so I tracked down one of his projects and spent a few minutes reading through his code. Looks pretty good...

My Favorite Toy Language

I spent some time last night thinking about MFTL. The basic data model is starting to shape up, but I still don't know how I want to handle numeric types.

LISP implementations have traditionally used tag bits to label object types. All data values (integers, object references, etc.) are represented by a single word, and you have to look at specific bit patterns to infer the type. For example, you might use the two least-significant-bits as a tag:

xx00: 30-bit signed integer
xx11: 30-bit object reference (mask low-order bits to zero and use as a pointer)

Addition and subtraction are easy (think about it). Multiplication and division require some extra shifting. Looking up objects is easy, too--just mask with 0xFFFFFFFC and indirect normally.

The big win: You can generate acceptably fast code, and your data model is easy to make thread safe. The big loss: Nobody wants to use 30-bit integers, not even in a scripting language. So I'll spend some more time thinking.


Everybody's leaving for school again! It's going to be lonely up here in the northern woods.

ICFP2000 Contest

The 72-hour hacking run is now over (I'm wasn't a participant; just an observer). Bruce, andreas and igor wrote some utterly amazing code. The big suprise, though, was Gabor Greif, who magically produced an optimizing compiler for the input language. These guys are absolutely incredible.


(This is a big rant; you may want to skip it unless you're a language geek.)

General purpose programming languages are great. You aren't limited to any one problem domain, and you can build big, modular software without too much trouble.

Special purpose languages are also great, but at a price. Consider MatLab. You can write all sorts of signal processing code without breaking a sweat, but you'll quickly run out of gas if you stray outside the problem domain. (Same goes for Perl 4 and text processing.)

Common LISP tries to balance these two extremes. It's a general purpose programming language, but it also includes an extensive customization toolkit. You can define new control constructs for your problem domain, and bundle them into a library. In essence, you can embed your special-purpose language inside of an existing general-purpose language.

LISP has always been popular in the AI community, because every new theory requires a new programming language. But for a completely trivial example of meta-programming, you might want to look at this Dylan snippet for locking a POSIX mutex.

My Favorite Toy Language

I'm designing Yet Another Programming Language. This may take a few years to get right. :-) For the sake of discussion, I'll call it MFTL.

MFTL has three design goals, not all of which are entirely compatible:

  1. Scripting. MFTL should be a convenient, easy-to-learn scripting language, on par with Python or JavaScript. This means the language should adhere to modern C/Unix/Java naming conventions, and should be implemented as an embedable C library.
  2. Compilation. It should be realtively easy to write very-high-performance code in MFTL, and compile it (probably to C). Ideally, I'd like to match the performance of C for number-cruching, but even 0.75C would be a big win. (I've published some Dylan benchmarks which might be of interest; you can find code in the Gwydion CVS server.)
  3. Meta-Programming. Many popular scripting languages are specific to a single problem domain. But these specialized languages also tend to be whimpy and annoy serious programmers. I think that meta-programming might strike a nice balance here.

Dylan succeeds on points (2) and (3), but does a somewhat poor job on point (1). I think it's possible to do a really excellent job in all three categories.


Wow! Several members of the Gwydion Dylan team are participating in the ICFP Programming Contest this year. They're cranking out 3D-rendering code at an impressive rate.

Unfortunately, my girlfriend leaves for college in a few days, so I can't participate in a 72-hour sleepless hacking run. I've offered to beat d2c's optimizer with a cluestick, if necessary, since nobody on the contest team will have time to figure out my documentation on high-speed collection types. (My code is basically a hack--it uses some hand-coded type substitutions instead of a fully general template model.)

Good luck to andreas, igor and Bruce!

Ugh. I'm taking a day off to change phase the hard way. So I've decided to kill time until the sun goes down. Potential time-killers: Laundry, cleaning and hacking on mod_virgule.

SQL in the config file? Ick.

Well, I'm working on the CustomDNS backend this afternoon. I'm trying to make it completely portable across different membership databases, preferably without requiring sysadmins to write any Java code. Maybe I can just put some table and column names into the config file.

(Will I run into trouble with crypted/non-crypted/MD5-hashed passwords? These all require different SQL code. Do I really have to put SQL code into my config file? Yuck.)

I always forget how much I like Java. Sun's politics are just awful, and some of the standard libraries are pretty silly, but there's something fundamentally sleek about the language itself. IMHO, a good language ought to be expressive, extensible, blindingly fast, and sleek. If nothing else, Java is sleek. :-)

(Is anyone working on a completely free implementation of J2EE, by the way?)

Long-winded philosophical stuff

welisc feels that Eiffel is sleeker than Java. I think we're using totally different criteria here. :-)

I hack on various parts of d2c, a compiler maintained by the Gwydion Dylan project. Now don't get me wrong--I like Dylan way better than I like Java. Dylan has closures, generic functions, multimethod dispatch, hygenic macros, and all sorts of other features that Java doesn't have.

From my (blatantly biased) perspective, Dylan is as almost as sexy as a language can get. But it's not sleek. Let me explain.

Dylan is tricky to optimize well (d2c gets 90% of C's performance for certain kinds of number crunching, but only with help from CMU's amazing optimizer code). Dylan doesn't have a well-defined notion of separate compilation. And Dylan has quite a few warty little features buried away in various places.

Dylan is a great language to hack in, but after doing some tricky optimizer debugging, I can safely say that Dylan is unnecessarily hard to implement.

Java, in comparison, is decades behind the state-of-the-art in language design. But it still provides garbage collection, separate compilation, dynamic class loading, introspection and a clean--but minimal--object model. And Java accomplishes all this and more without being especially hard to implement.

That's what I mean by "sleek". It's a term of admiration for compiler writers who understand Larry Wall's virtue of laziness. :-)

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!