14 Ways to Write a Spelling Corrector

Peter Norvig posted this article explaining how implement an “industrial-strength spell corrector like Google’s” in only 21 lines of Python!

This article is a pretty fun read, especially for folks looking for fun problems to solve in their programming language of choice (or hopefully in the new language that they are currently learning). Be sure to check out the implementations that folks provided in other languages.

Edwin: The Movie

MIT Scheme is a fine Scheme distribution. Their editor, Edwin, however, has always been sort of a mystery to me. I can’t find anyone that uses it, documentation that “speaks to me”, or even a user guide on how to get the most out of it. Aaron Hsu, psychically detecting another Schemer in need, recorded an introduction to Edwin that provides a nice peek into some of its features.

Operating without change

How powerful is a programming language in which you do not utilize mutation?

Apparently very powerful. So much, in fact, that it was used to build the first prototype of the Fortress programming language.

Prediction for 2008, a new functional programming motto will emerge:

“Purely functional data structures: Strong enough to build a fortress!”

The benevolent dictator behind Java

There is a widespread belief among most Java programmers that while syntactic extension is indeed valuable, its introduction to Java would result in, among other things, human sacrifice, dogs and cats living together – in other words: mass hysteria. What I meant by “most programmers” is really just one Java programmer, Gilad Bracha.

Ostensibly Gilad is right on about this one. Macros will result in horribly unreadable code; but we all know that is not true. We have all seen unreadable code, in any number of languages that haven’t got macros, and even in Java (sorry Gilad). Macros in Java would ultimately expand into Java, which every Java programmer could read; so the idea that Java programmers couldn’t read the code is pretty far-fetched (not to say that folks wouldn’t use macros to generate unreadable code, which is entirely possible). Gilad knows this, though; he is a programmer, so I don’t really buy his marketing mumbo-jumbo on this one. So I wonder, what exactly his point is. It probably isn’t even fair to try and grok his point from the little excerpt provided in the link, but here goes anyway.

His point is that Java follows the approach of providing a lot of specialized constructs rather than a few general constructs on which to build new features; so macros would not a good fit (for comparison and contrast see “Programming languages should be designed not by piling feature on top of feature…”).

Simple. Succinct. Consistent. All the signs of someone who knows how to make a decision. Thanks Gilad!