Older blog entries for itamar (starting at number 9)

On Saturday I was at the Lightweight Languages Workshop at MIT, and here are notes about some of the talks. There's a webcast available from the website.


First talk was Erlang, which is very interesting. It's a functional language, and designed for concurrency - you can launch tens of thousands of processes, and pass messages between them. And this is done fast - 2 microseconds to start a process. Apparently Oz shares a lot of the concepts here as well.

OS-level services in Scheme

Second talk was about the ways PLT Scheme (MzScheme?) is incorporating OS-level functionality into the language.

PLT Scheme OS-like capabilities that I found interesting:

  • killing threads cleanly
  • Indepent GUI eventspaces (e.g. independent regarding modal dialogs).
  • custodian manages resources for threads so you can easily shut it down.
  • enforce abstractions (like Java's private?) and then add hooks for bypassing it for debugging.

This is very useful for IDEs. They have example IDE that lets you run say, infinite loop in interpreter, without the GUI freezing up, and because you can kill threads you can cancel this operation. In addition, GUI you program via IDE runs in its own event loop so it doesn't interfere with IDE's event loop.

Apparently the author is spending a lot of time making the blocking OS level facilities not block, so he can do this sort of thing.

Asynchronous Exceptions in Python

The fourth talk was about raising exceptions in signal handlers in Python, and the problem this causes. Basically the issue is that in e.g. this code:

f = open("file")
    s = f.read()

the file may never be closed, since a signal might raise an exception right after file is opened but before try/finally. The obvious solution is too disable the signal around this code, but this is TOO MUCH TYPING, and you MIGHT FORGET to reenable the signal. So what was suggested? Adding new keywords! They gave following example code:

    f = open("f")
            s = f.read()

where block/unblock do that to signals. I think this is terribly wrong. First of all, their own example was wrong, it should actually have been:

    f = open("f")
            s = f.read()

This is totally ridiculous - you need to wrap each block of code this way, it blocks all signals instead of just the appropriate one, and the syntax totally violates the standard behavior of existing keyword pairs in python, since they are on different indentation levels.

I think raising exceptions from signal handlers is just a messy idiom, and they just shouldn't be doing it. And given you don't need a keyword to solve the problem, you just can use the signal module, their suggestion is just badly implemented syntactic sugar, with side effects that extend beyond the problem they want to solve.

I might write up the rest of the talks tommorow.

11 Nov 2002 (updated 11 Nov 2002 at 05:31 UTC) »

Cory Dodt suggested paying Iraqi soldiers to surrender. This actually works quite well - lets say you have 100,000 Iraqi soldiers. If we give each 1 million US$ to surrender, that comes to $100 billion - half the projected cost of the war. Quote from #twisted:

or maybe just pay his army to surrender. it would cost less than shipping 250,000 troops over there, i'll bet you. the oil companies would probably chip in too
we could get everyone involved. like sponsoring a starving child in africa. except you're sponsoring an iraqi to surrender.
i wonder if we could get them to write their sponsors letters. "thank you for not blowing me up. thanks to your generous donation of 1 million dollars, instead of being dead, i am now an oil magnate in my native country."

Tommorow I'll post my summary of Little Languages Workshop (preview - Erlang, I ask stupid questions and get put down in public, suggested Python atrocities, and more).

The International ANSWER coalition organized the Oct. 26 anti-war demonstration. There were between 100,000 and 200,000 in Washington DC, and another 20-80 thousand in San Francisco. That comes to a total of about a quarter of a million people. I was at the DC one, and did my small part to help organize it in the NY branch, and it was very impressive indeed.

VoteNoWar.org is their next effort, leading up to a Peace Congress and another, hopefully larger, demonstration, once more in DC. Please help out - sign it, donate, volunteer with your local organizations, pass it on to all your friends.

Raph Levien has kindly retrieved my password for me, so I can post once more. Thanks!

Inspired by mjcox, I wrote a python script to download Advogato diary entries and parse them into a useful form, for embedding into other pages: http://itamarst.org/downloads/

People pointed out on my article on multiplexing, reinventing the wheel tends to be a waste of team. I don't really agree (you get to learn how wheels are made), but they do have a point. The point being that you'll get ahead a lot faster if you use an existing implementation.

So I (temporarily) stopped using my multiplexing code and switched to multiple connections as in http. This let me concentrate on the imporant parts and not get stuck with bugs in the mux code, Once I'm done I'll switch back to my code or BXXP if it's ready.

FTP sucks.
In order for it to work, I need to support paths like ".", "./", "./name/", "name/", "name" and so on. Another problem is that FTP is not at all suited to working with browsers or multi-window filemanagers. HTTP is so much nicer - I wish I could find a working Python WebDAV server.

I'm working on too many projects at once.

At least Wholepop is finished. I'm sure someone here (the 1.0e-2 people who'll read this) will enjoy the Barbie Liberation Operation.

I finally wrote some docs for Zope: Developer's Guide to Zope. All the links you'll ever need to learn Zope.

14 Sep 2000 (updated 14 Sep 2000 at 15:52 UTC) »

I can't figure out why deekayen and nixnut certified me. nixnut I guess as a Zope user, but deekayen uses *blech* PHP. I used to use PHP, but I know better now.

I certainly sympathize with deekayen's complaints - consider the homework in Tel-Aviv U.'s "Advanced Internet Topics" course:

  1. Create a homepage
  2. Create a Java applet that displays your name
  3. Animate it
  4. Create an IM clone

Could be worse, but still...

I really recommend a Computer Graphics course - very interesting, with actual focus on making your programs efficient not only in complexity but in actual speed.

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!