Blog Contact Software Music
Console DJ

pytone is a terminal jukebox … sort of the curses equivalent of itunes. found about it earlier today from the uncle, and i’ll never be the same again. if you’re on the look for a decent player, give pytone a try - you’d be surprised!

Io - Prototypes for ordinary people

Some programming languages look like they were designed especially to secure their authors a place on LtU - sort of 15 minutes of fame for language mavens. That’s not the case with Io, although it does sport some neat features that are not common enough in today’s language universe (and it did make it to LtU, which is how i found out about it).

Io is a small, dead simple dynamic language. It’s most important characteristic is it being a prototype-based pure object-oriented language. Unlike many popular OO languages, Io lacks any data types that aren’t objects - that includes classes, which are common as a generalisation mechanism in other languages, but are dangerous because they pollute a language with an entity that is above the normal object space and often make it much less intuitive to reason about OO design and to interact with live systems. Instead, in prototype languages like Io (and like Self, the ancestor of all prototype languages, Javascript and Slate, to mention a few) new objects are created by cloning existing ones. Cloning does not really copy an entire object, it only creates a pointer to the original object, the prototype, and stores any changes to the new object later on, if and when it’s modified.

As I mentioned, Io is not the only prototype language out there, but it is unique in being a very simple, geared towards down to earth programmers in need of a powerful tool. It is not a grand research project, a new operating system replacement or a domain-specific extension. Io is a ’scripting’ language, in the same sense that Python, Perl and Ruby are. It is extremely dynamic and introspective, allowing the program to inspect and change any of its components in runtime, and is running on top of a simple virtual machine written in portable C. In addition, Io is very easy to learn, thanks to the almost complete lack of special syntax (in Io even assignment is achieved by passing a message to an object).

After i found that the SGML parser bundled with Io is not good enough (the current distribution comes with a generous collection of libraries, though quality and maturity vary), I have decided to try and build bindings for Gnome’s libxml. Libxml comes with XML definitions of its entire public interface, and using a bit of XSLT i transformed them into Io code, which looks very much like LISP S-Expressions (sure, I would have loved to use Io itself for the task, but the lack of working XML facilities was an obstacle, of course). This is where the problems began. Libxml is rather big, and I found, to my great disapopintment that the version of Io I have cannot parse the entire generated program, running into some artificial memory limitations before completion. I was even more surprised to find out that not only could I not configure this parameter in either run or build time, but that the magic number I wanted to control was hard-coded (not even using a define) and buried deep in the source.

After many attempts (and many more similar problems) I have discovered Io’s DynLib object - a useful little object that allows you to bind to shared C libraries in run time, and I am now directing my efforts in this direction. After finally being able to get some basic results, yesterday’s so-called stable release rendered my experiments useless again. Languages in development are indeed a moving target, but this contrasts with the claim of the language designer’s to have a 1.0 release baking, out by the end of the year.

In conclusion, Io is a wonderful little language, and I think it has a great potential in same niche occupied today by other ’scripting’ languages. I sure do hope to be working more with it in the future. However, judging by the current state of the codebase and the amount of changes the language and its basic libraries have taken even in the very short time I’ve been watching the development, we are still far away from a 1.0 release.

Breaking CAPTCHA

a captcha (completely automated public turing test to tell computers and humans apart) is a program that can generate and grade tests that most humans can pass, but current computer programs can’t pass.

in practice, it’s one of those images of distorted text one is often required to enter when signing up for free web-mail or other such services. they are implemented in order to prevent bots (computer programs masquerading as humans) from abusing such services, by signing up for thousands of accounts and using them to send spam, for example.

just as the science of designing these programs is evolving, so is the science of defeating them. it’s hard to tell which is more fascinating.

greg mori and jitendra malik of uc berkley have written an algorithm for defeating gimpy, one of the most common captchas (the one used by yahoo, for example).

interestingly, although their approach relies heavily on the letters in the test being part of a common word, it’s hard to see why these tests don’t use meaningless strings of letters. most humans, i think, would have no great difficulty passing such a test.