R6RS sucks

June 13, 2007

I finally read the latest draft spec for R6RS. Of course, no spec will ever make everyone happy. But my objections stem from the guiding principle of Scheme described in the very first sentence of all RnRS reports: “Programming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make additional features appear necessary.” Some items in R6RS are a pile of features that reduce our ability to extend Scheme.

  • Libraries: It is impossible to invent a library system that makes everyone happy. Therefore, they should have created a minimal library system (which they almost have) that is extensible. If I could apply macros to the library spec, I could create most of the features I want in a portable way. Someone said you could write higher-order modules within R6RS’s library system, but I don’t see how. Without it, Scheme basically has C’s module system. Pretty lame.
  • Records: I’m glad they added it, but they required support for inheritance, sealed & opaque fields. This is overkill. I would have preferred a simple record library. Then another “object” library layered on top. In the current form, do the type predicates understand subtyping? If B is a subtype of A, will (is-A? b-object) return #t?
  • Exceptions: These are necessary, but they may have gone too far. The problem is it relies on records for inheritance, and they offer a plethora of exception types. I would have preferred the spec require a single exception type (“error”). If you want to support more types, then you can optionally use inheritance to extend the base exception with more specific types. The point is we should be able to do this ourselves, but now we are trapped by their overdefined implementation.

I know that writing a standard is a difficult and thankless job. And it inevitably annoys a lot of people when you don’t add their favorite thing. But with Scheme, the ideal is to not add everyone’s favorite thing. The ideal is to add only the minimal thing required for others to build their favorite thing on top. So I think I’ll vote against R6RS (assuming they’ve processed my registration).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: