Paul Graham has finally released Arc. After reading about it, I'm quite disappointed. I have a lot of respect for Paul Graham, so this surprised me. Here's a perfect example of why I'm disappointed:
Which is why, incidentally, Arc only supports Ascii. MzScheme, which the current version of Arc compiles to, has some more advanced plan for dealing with characters. But it would probably have taken me a couple days to figure out how to interact with it, and I don't want to spend even one day dealing with character sets. Character sets are a black hole. I realize that supporting only Ascii is uninternational to a point that's almost offensive, like calling Beijing Peking, or Roma Rome (hmm, wait a minute). But the kind of people who would be offended by that wouldn't like Arc anyway.
Not supporing Unicode? This is not merely a matter of being offended. It's a matter of "can I use this code or not?" The very next sentence reads "Arc embodies a similarly unPC attitude to HTML." ASCII-only isn't "unPC", it's stupid. It means, right off the bat, that many, if not most of the world's programmers can't use it for any serious work. By his own admission this project he's talked about for years would only have been delayed a couple of days. I'm flabbergasted.
So what is his "unPC attitude to HTML"?
The predefined libraries just do everything with tables. Why? Because Arc is tuned for exploratory programming, and the W3C-approved way of doing things represents the opposite spirit.
In other words, Arc is a toy and not to be used for real projects (to be fair, Graham himself describes Arc as for "exploratory programming", whatever that is). I assume we could write our own proper HTML libraries, but Graham seems to be encouraging developers to do the wrong thing
I can forgive the tables since one can presumably work around it, but failing to spend a couple of days resolving the ASCII-only issue is disappointing.
But what does Arc code look like? Maybe it's clean enough that we should forgive its sins.
(def firstn (n xs)
(if (and (> n 0) xs)
(cons (car xs) (firstn (- n 1) (cdr xs)))
Right. Now we have to try to explain to new Arc programmers that the origins of "car" and "cdr" are "Contents of Address of Register" and "Contents of Decrement of Register" respectively (which makes sense if you know the historical reasons). Why? Why not just call them "head" and "tail" and make it simple? This compiles down to Scheme and this could have been built-in up front. Instead, historical baggage which confuses new programmers has been left in. Here's what I would have liked to have seen:
(def first_n (n list)
(if (and (> n 0) list)
(concat (head list) (first_n (- n 1) (tail list)))
OK, switching "cons" to "concat" may not be that big of a deal, but with the above code, programmers who don't know the language have a much better chance of understanding it. Further, note that I've changed the variable name xs to list. Is see xs used all the time in languages like Prolog, Lisp and Haskell, but these point to mathematical underpinnings and to my mind, are mental speed-bumps. While this is certainly something a programmer can change, examples should be written to reduce the cognitive load so long as they don't sacrifice correctness.
I'm also not convinced about the lack of support for OO programming in Arc. He has a fascinating follow-up about confusion in the OO world, but his primary justification (first link in this paragraph) seems to be:
I personally have never needed object-oriented abstractions. Common Lisp has an enormously powerful object system and I've never used it once. I've done a lot of things (e.g. making hash tables full of closures) that would have required object-oriented techniques to do in wimpier languages, but I have never had to use CLOS.
If you read that carefully, that almost sounds like he's saying "OO programming isn't important because I don't use it." I have never done a lot of purely functional programming and after having read HOP (Higher Order Perl) and worked through the examples, I can sympathize with Paul Graham's position, but given what I've seen in Arc, I'm far less ready to agree with him.