Programming with Continuations

this article from IBM describes how one can use “continuations” to write simpler, clearer, more powerful web-based applications. It assumes the use of a special programming framework which makes continuations trivial to use. I don’t happen to have access to that framework but it was a cool read because I’d heard about continuations before in my old “learning about lots of obscure and interesting programming languages” habits, but I had never really felt I had understood what they were good for.

Specifically, it discussed the use of “continuation-passing style” which is possible even in languages which do not explicitly facilitate the use of continuations. More on that here.

Ubuntu Linux

For eons I’ve had a little linux desktop machine that’d degenerated into a headless server sitting around. I have these dreams of eventually doing more with it.

I wanted to move it. That was difficult networkingwise. But I got a Best Buy gift certificate for Christmas, and I decided to use it to buy a wireless PCI network card for the beast, so I could move it wherever I wanted (e.g. the living room).

I soon learned that getting the Linux pci wifi drivers for my card working on old-school Debian would be an exercise in pain. Ugly recompilations of this and that. Precise instructions on the web that don’t actually work and result in ugly C error messages during compilation.

I happened across this article at O’Reilly which described Ubuntu Linux “just working” with a wifi card. I decided to give it a try. It had been literally years since I’d installed Debian on that box; why not give a new distribution a try?

It didn’t go 100% smoothly but it did go remarkably smoothly. The wifi card did not work out of the box with native drivers, as I’d hoped, but it did work with the help of ndiswrapper, which turned out to be gloriously easy to use. (Strangely, also, it only works when I have my regular ethernet card in the box too. I tried taking it out and the wireless one stopped working. The regular ethernet card doesn’t have to be plugged into a network, or even configured in /etc/network/interfaces — it just needs to be physically present in the box. Whatever.)

I couldn’t get sound working right, but that might be because the box has two soundcards, both of which are crap (one built into the mobo and one installed), and it couldn’t decide which piece of crap to use. I don’t know. Linux sound hates me.

But everything else just worked, with no hassles. It was a whole new Linux experience. All that and it’s Debian under the hood, and if you want you can use the pleasant, easy to use packaging tool to install Debian software from the main Debian repository as well!

I would highly recommend Ubuntu Linux.

Tor and Privoxy

Caught some noise about Tor today on Slashdot. Interesting stuff.

Tor does two things for you — first, it routes your internet traffic around a bunch of anonymizing servers before it reaches your destination — yet does it fast enough that you don’t notice a delay to speak of.

Second, it gives you access to content which is hosted within the tor anonymous network itself, so-called “hidden services.” Anything that can go through a SOCKS proxy can be a hidden service. That includes web sites, telnet, irc, whatever. If you run a Tor server, you can offer content to the net without revealing the IP address that content lives on — and not offer it to anyone who’s not on the Tor service.

So it’s a combination of a distributed anonymizing proxy network, like Peekabooty, and an anonymous network on which you can offer content, like Freenet but not completely, unusably sucktastic.

This stuff actually works. I’m accessing a hidden service wiki right now that discusses some of the fine points of Tor-fu. It seems a little slow right now, but considering the service just got slashdotted, not bad.

But here’s the other nifty bit. They recommend using Privoxy to provide better web anonymity, because Moz-based browsers leak identifying information through a socks proxy like Tor. So I installed Privoxy.

And, man, has Privoxy come far. There’s a spiffy little OS X installer, there is a built in web page where you can configure your own privoxy through your web browser, there are bookmarklets to turn it off and on, its ad blocking is great… This Tor thing, well, nice and all, but Privoxy is cool upon cool upon cool. Highly recommended. Not just for total geeks anymore.

Mouseover DOM Inspector

slayeroffice | Mouseover DOM Inspector:

This favelet allows you to view the properties of any HTML element on a page simply by mousing over the element. The element will be given a gray background, and a DIV element that trails the mouse cursor will contain the element type along with all of the specified attributes of the element. Hit the “esc” key to turn the favelet off.

Via Sam. Crazy cool and a must-have for any web designer.

Squeak Ambivalence

I’ve been dinking with Squeak again lately.

The thing with Squeak is that there are numerous levels to it.

There’s the classic Smalltalk level.

There’s the new Morphic environment, which was borrowed from the Self programming environment. Morphic was originally (in Self) designed as the visual environment for prototype-based programming par excellance, but of course Squeak is Smalltalk, which is class-based, not prototype-based, so there’s less than a 100% perfect fit there.

There’s the eToys programming environment, which is a visual programming environment built within and on top of Morphic. eToys is prototype-based, and this is accomplished, as best I understand it, through a hack on the Smalltalk environment in which every new object in the eToys environment generates a new singleton class. eToys is an entirely visual programming environment; you literally write code by dragging and dropping tiles into code templates. It’s suprising how much cool stuff you can accomplish there.

I’ve been infatuated with Squeak for several years, but it’s a very stormy relationship. There is so much to Squeak — there is so incredibly much in there — and it’s been developed nonstop very rapidly for years — and the documentation is abysmal, and gets very rapidly out of date. If you look at the Squeak mailing list (populated by elder gods of programming like Douglas Englebart and Alan Kay!) you will find a constant stream of newbies fascinated by Squeak, trying to accomplish something, and baffled by the overwhelming uberty of the Squeakiverse.

I have this dream of using Squeak to make neat little toy programs that my kids would enjoy. Like, I want to make something where you have these little blocks with different colors and they play different notes. And you can put them in a row in a container and play the whole container to make a tune.

That seems perfect for Morphic/eToys. So I tried it. First I tried to just do it in eToys. It was a hoot playing with eToys’s visual interface, and the neat tricks you could make things do, but I found out there seemed to be no connection between eToys and the internal Midi music system in Squeak. Whoops! Environment shear! So I had to go into the Morphic world and make a Morph that could do what I wanted. I succeeded with some effort, but never did quite figure out 100% how to give it a menu that would let you choose the note that the thing played. (I did set it up so that the morph was a different color based on what note it was, and that was wayyy slick how that worked. I was jazzed about Squeak when programming that part.)

I thought, “I should make this morph work in the eToys environment. If I could program it with tiles, I could do the rest of what I want easily.”

No luck there. I couldn’t find doco anywhere on how to give a custom morph its own special set of tiles, and I couldn’t figure it out by reading the code in existing morph classes before frustration and anger at wasted time overtook me.

This is always how it happens. I have a neat idea, I figure out how to do it 40, 60, 80%, and then the rest of it just kills me.

I need to swear off the Squeak. It’s so cool and powerful that it tempts me, it sucks me in, and then it bites me on the ass every time with its lack of documentation and overwhelming complexity.

I think I need to learn Flash or someting. People are always doing in Flash the general sorts of things I would like to do in Squeak. I wonder how much it costs.

Gotta get me away from that Squeak. It sucks all my free time and gives me temporary delight and ultimate disappointment.