Archive for January, 2008

Lisp hacking in the 21st century

I’ve actually been working with Lisp in various forms since 2000 or so, when I started working at the Kestrel Institute. They built this amazing high-level formal language for building and refining specifications software specifications. As your spec became more and more concrete, eventually parts of it could be turned into executable code, which in this particular system’s case meant Common Lisp. (Since then, I believe they’ve developed C and Java code emitters, as well, but many of the tools used to implement the language were themselves built in CL, so it always had a major place in their world.)

Not too long after that first exposure, I started following some of the writings of Paul Graham. I think his language Arc first caught my attention some time in 2002, when it was presented in a series of essays about his ideal next-generation Lisp. I agreed with a lot of his points — terseness is good, collections should act like functions, web applications are key to any language in this era — but after about two years, pretty much wrote the whole thing off as vapour.

Lo and behold, I hear via Twitter from my friend Ben that Arc had, in fact, been released. I read the tutorial, which despite being fairly obtuse for anyone who doesn’t have prior Lisp experience, gave me enough of a roadmap to start tinkering. One Linux-compatibility patch later, I was up and running with a minimal Arc environment and web application server.

(Quick impressions after the fold.)

My first impressions were mixed. I like the basic set of forms, and the terseness is a much-appreciated change from the verbose identifiers of Common Lisp and Scheme. Bundling a web application framework (complete with simple authentication and persistence tools) is a stroke of genius, though it is nearly crippled by the absolute lack of anything resembling documentation.

On the negative side, I have to say that the total lack of a reasonable standard library (and similar lack of documentation for the handful of functions that do exist) strikes me as frankly disappointing. Yes, I know this is supposed to be a “preview” release. On the other hand, Paul claims that he’s been using Arc as a primary development environment for some time now.

To that, I can only say that his needs for development tools must be very different from mine. Without basic string-manipulation tools like regular expressions (even in a Lisp-ish form using S-expressions instead of Perl syntax) and tools for XML and JSON processing, I can’t see how anyone could claim to build full-featured web applications with this system. I suspect that any production system using Arc in its present state would spend a lot of time forking helper scripts to handle any I/O that couldn’t be done via S-exps.

(Strangely enough, that was exactly what Kestrel’s Lisp code did in almost all cases other than basic parsing. When we needed to communicate with the outside world, it was via S-expressions on the filesystem or passed over TCP sockets, and it was up to the program on the other end to translate into whatever other formats we needed. That model kept us pretty well tied to XEmacs as a front-end for quite a few years longer than was really seemly…)

Design request

This is an open request to any and all consumer electronics manufacturers out there.

If you are designing a product that might, for any conceivable reason, be connected to a personal computer, please make your connection via a standard USB cable. Mini-USB, in particular, is a wonderfully common, compact connector capable of carrying both high-speed data and power.

Now, the latter point is particularly important. I am absolutely sick of having a separate, incompatible power adapter for every damn gadget I own. In addition to the clutter and confusion of determining which cable goes to which device, I have to live with the annoyance of either unplugging them after every charging cycle, or knowing that I’m literally throwing away energy as they sap power out of my wall sockets.

So, if your total battery capacity is such that charging can be completed over the afore-mentioned USB cable, by all means, allow me this luxury.

As an example of a device which does this properly, I offer my new smartphone, the BlackBerry 8320 (a.k.a. the T-Mobile “Curve”). It has a single mini-USB port on the side which is used for both tethering and charging it. Furthermore, when tethered via this cable, I can see the internal flash storage as a standard external USB disk device, which makes transferring MP3s, photos, and other data on and off the device stupidly easy.

Going partway there, but stopping just sort of this sort of nirvana is my point-and-shoot camera, the Canon SD800 IS. It’s a wonderful little picture-taking device, and does use a standard mini-USB port for data transfer to a computer. Unfortunately, it does not support charging over USB, or indeed charging the battery while inside the camera at all. Instead, I have to remove the battery and place it into a wall-mounted charger which has approximately the same volume and mass as the camera itself.

Finally, in the “snatching defeat from the jaws of victory” department, we have my music player, the 2nd-generation iPod Nano. It connects to the computer via high-speed USB, and charges at the same time, which is great. Unfortunately, it uses a totally proprietary cable; even worse, the cables Apple manufactures are thin, cheap pieces of junk, and cost something like $20 apiece to replace. For shame, Apple; after more or less single-handedly bringing USB to the masses, you turn your backs on such a useful standard in favor of a single-device solution?

In case it’s not apparent, I have recently had to replace a number of these stupid proprietary cables and chargers, despite having a half-dozen or so standard USB cables lying around. My wallet and desire for simplicity and compatibility between my devices both cringe every time I see a non-standard connector.

Super-Duper-Fat-Burning Tuesday

No, it’s not a new exercise segment on some morning show…it’s the insanity that is a huge number of really interesting events being scheduled on the same day. Specifically, Tuesday the 5th of February.

First and foremost, it’s the first incarnation of the new [Super-Duper Tuesday](http://en.wikipedia.org/wiki/Super_Duper_Tuesday) mega-primary for the presidential election. It covers 28 states, and over 40% of the delegates will be pledged in one day. Anyone winning big a week from now is going to be hard to shake from that top seat…which is pretty annoying for us residents of Oregon, since our piddly number of delegates are unlikely to have much influence by the time we get around to voting some time in April.

Next, we have Fat Tuesday, a.k.a. Mardi Gras. I don’t think I have to say much about this, other than to express a bit of disappointment that I will, once again, *not* be in New Orleans on this day of the year.

Finally, there’s [Ignite Portland 2](http://www.igniteportland.com/), which would under normal circumstances trump most anything else going on in town that night. Unfortunately, I have become somewhat of a total information junkie during elections; I need not only basic WiFi service, but a group of fellow addicts, each compulsively hitting “refresh” on a handful of elections office pages and streaming CNN, C-SPAN, Fox, and anyone else covering the returns in real-time.

mod_rewrite hack of the day

Since I host a lot of little webapps on my development workstation, and use SSL to protect passwords and other sensitive data, I have a lot of special proxy settings in my Apache config. I realized today, though, that I could replace most of them with the following single line:

RewriteRule /port(\d+)/(.*) http://localhost:$1/$2 [P,L]

Now, to access a Rails app running on port 3000, I can just request https://myhostname/port3000/, and the request will pass through the Apache proxy into the Mongrel backend. The same works for /port8080/, /port10080, etc., etc.

pacman cupcakes




pacman cupcakes

Originally uploaded by hello naomi

/me wants. i don’t even like sweets, but damn, these look awesome.

ground kontrol needs to sell these. stat.


signage




DSC_0141

Originally uploaded by rcoder

The nearest acceptable coffee shop* to my house, Muddy Waters, has some great signs painted on their front windows. Whoever did the lettering has a fun style: light and organic, but still consistent and professional.

Plus, they’re getting a limited liquor license, which is nice; sometimes, you want that Sunday afternoon beer in a place with decent music, free WiFi, and no smoke. Until the smoking ban kicks in next January, that pretty much means coffee shops, at least in my neighborhood.

* An acceptable coffee shop must get a few basic things right. First and foremost, their house blend coffee must always be fresh, and drinkable black. If an airpot full sits out long enough to get stale, it should be dumped, not left out for customers to empty over the rest of the day. Secondly, it must cost no more than $1.50, with at least one refill. Anything more is just price-gouging.

Aside from that, all I ask is that the music not completely suck, and the WiFi be reasonably reliable. I can even flex on the WiFi, if the coffee is better than average.


Still life with smartphone

Still life with Crackberry

I’ve been away from the computer due to travel and the Bus [conference](http://rebootingdemocracy.com/) for the last week or so, but since I finally bit the bullet and got myself a [Crackberry](http://www.urbandictionary.com/define.php?term=crackberry), I haven’t been away from email, IM, or [Twitter](http://twitter.com/rcoder/).

It’s a pretty nice piece of kit — the T-Mobile BlackBerry “Curve”, which supports WiFi in addition to the GSM/EDGE network for data *and* voice calling. The latter is especially important to me in a work phone, since many areas on Reed campus (like my office, or the server room) don’t have any cell phone signal to speak of.

Unfortunately, I haven’t worked out a graceful way to blog from the handset yet, so things have been pretty quiet around here. Expect more regular updates once I either figure out a solution for posting on-the-go that doesn’t hurt too much, or give up and go back to hauling the laptop around with more regularity.