The Arc Debate

February 28th, 2008

Hey, everyone, Arc is out! As if you didn’t know. I mean, I think the internet backbone has been saturated with refreshing news.ycombinator.com to be able to post the next reply.

But seriously, as one of my last blog posts, I thought I might shed a meager light on the issue. There are a lot of statements, many true, many untrue, many other, that have been made about Arc. I’d like to address some of them, one at a time.

First, though, if you don’t know, Arc is a recently-released Lisp programming language by Lisp pundit Paul Graham. He is also the guy who started the Y Combinator venture capital firm. And he wrote news.ycombinator.com in Arc before he released the language to the public. Now it’s out, and look at the raucous.

So, some of the finer points about the Arc debate:

People ask Why doesn’t it do Unicode? The language is meaningless if I can’t use Unicode.

See: here briefly here here here

This seems to be one that Paul Graham has tried to address himself. Simple answer: Paul Graham doesn’t need it, it doesn’t give him much value, and it’s not one of his priorities. What were you expecting? A Python killer? Everything that has ever been said about Arc by Paul Graham has indicated a small, minimal language based on a few principles: terseness of programs and axiomatic definition of the language and libraries.

People say It’s just a bunch of name changes from Common Lisp, with only minor extensions. Students write their own Scheme interpreter in a semester in college. This is nothing different.

Ok, yeah, you could write it in Lisp. And guess what, he did. But he wanted to do it in a different direction from where scheme and common lisp went. Above, he wanted to maintain the principles that he set out to abide by from the core of the language up. That’s why it’s different. It’s a fresh and evolving start. Yeah, you could write something similar in a semester in college. But the fact that it is stable (it runs news.ycombinator.com) and that the programs continue to get shorter shows that it’s more than that and that his principles are still working. It is an experiment in language design, not a fixed point in language practicality.

People say After six years, this is it?

Well, in those 6 years he has obviously been pretty busy with spending his millions. Give him a break.

People say Continuation-based web programming is equivalent to cookies/sessions/query string state.

No. They are not. Continuation-based web programming lets you program in a natural, structured programming style. You avoid the spaghetti code of html links you have to write. Continuation-based web programming lets you program in a functional style, not a goto style like the rest of them. Functional style programming is better for exploratory programming, which is one of the reasons Paul Graham started to write Arc. And one of the main reasons he gives for choosing Lisp in general. And it trivially fixes the back-button problem. Oh, why not a list of all the reasons to use continuations?

  • No back-button problems
  • Multiple tabs/windows with different state
  • Functional style (forms look like function calls)
  • Easy to modify/maintain
  • Easy to read
  • Easy to write
  • Easy to wrap with more functions/macros

People say Continuation-based web programming lets you do all sorts of cool stuff, but what about global state which is shared by all windows/tabs?

Yeah, you know what? Multiple continuations can be closed over the same variables. That means you don’t have to worry about that. Or, you can just use sessions, if you really want.

People say Arc uses tables-based layout. What about CSS and accessibility?

Yeah, this one is tough. Paul Graham says he uses tables because they are more programmer-friendly (they let you explore). But this leaves screen-readers (for the seeing-impaired) in a mire of rows and columns, with no discernible order. It just isn’t important enough to him.

Well, this post is pretty messy, disorganized, and whatever. I don’t care. Here are a bunch of links, if you want to read all of the buzz. You might also like them if you’re a Google linkbot.

Lisp at Light Speed: Arc debarks
Hacker News | Take the Arc Challenge
Take the Arc Challenge
Arc - the Hundred Second Language - Robert Synnott
Arc is not a lot, but could it be?
Rondam Ramblings: My take on Arc
[FoRK] Re: Arc’s out, Nu vs. newLISP, and a retort to Paul Graham’s elitism
Stevey’s Blog Rants: Lisp is Not an Acceptable Lisp
Stevey’s Blog Rants: Lisp is Not an Acceptable Lisp
The Software Maven: An Arc-Tangent
Lisp at Light Speed: Arc debarks
Arc Forum | Infix Math
programming: Dear Proggit: Lets not start posting every toy lisp interpreter every hacker has ever made with titles like “This guy made his own arc in 2 weeks!”. Thanks.
Paul Graham’s Arc is released today… what is the long term impact? - comp.lang.lisp | Google Groups
Arc - An Unappreciated Approach to Language Design - Beautiful Code
Arc is released | Lambda the Ultimate
On Code: The ‘pre Arc’ Arc
Arc’s Out
Lisp at Light Speed: Arc Brevity
Zach’s Journal - Like a Bi-Metallic Strip
Drinkable Chicken » Arc, first impressions
(cadr life): Lazy Lists in Arc
smuglispweeny: Arc!Cells: It’s Alive!!!
smuglispweeny: Arc!Cells: Baby Steps
Arc Forum | Musings on Language Design
John Graham-Cumming: The Arc Challenge Explained
Fixing Software: A Wiki in Arc
Arc Forum | I have more challenge for you.Do the same thing, but make it survive a reboot of…
Object Oriented Arc
Arc’s if « Occasionally sane
ArcLite - Arc Ported to JavaScript
Lukas Renggli: We take the Arc Challenge
Lukas Renggli: We take the Arc Challenge
smuglispweeny: Meaningless First Impressions of Arc
Listening To Reason: Some potential advantages of Arc
Dude where’s my charset! | Schmevelopment
search results
On Arc, Paul Graham, and Unicode support as an exercise for the programmer // plasmasturm.org
Arc’s Out
ndanger.organism ::
blog :: Language design and Paul Graham’s dirty strings

Paul Graham on trolls | MetaFilter

Popularity: 6% [?]

A Clarification

December 18th, 2007

Nikodemus Siivola writes:

> Huh? #’ gets in the way and #L does not?

No, they both get in the way. Thanks for pointing out my omission.

> How is the CURRY klunky?

I wasn’t clear. When compared to Haskell, where you can write

fun 3

then

(curry #'fun 3)

is more klunky. Especially when currying and composing multiple times, as in this function which computes the sum of squares of a list of numbers:

(compose (curry #'reduce #'+) (curry #'mapcar #'square))

I would just much rather see something shorter. In Haskell (using the same function names):

(reduce +) . (mapcar square)

This was a failed attempt at clarity and brevity:

#M(#R(reduce #'+) #R(mapcar #'square))

I wish the syntax were better, still.

>Finally, I really don’t understand why to use a reader-macro for this when regular macros work for similar purposes more then fine.

Now that you mention it, reader macros do seem a bit overkill.

>Use macros when fuctions won’t do, and use reader-macros when macro’s won’t do is a good rule of the thumb in my books.

Yes, very good, it seems.

>(defmacro <- (&body body) `(lambda (_) ,@body))

> …with the added benefit that the user can macroexpand the form for instant comprehansion.

Yes, that’s good. I hadn’t thought of that. Thanks for the idea.

> I just so do not get this.

Sorry for the confusion.

Popularity: 3% [?]

Today is Make a Package ASDF-Installable Day!

December 11th, 2007

I hereby proclaim December 11, 2007 to be

Make a Package ASDF-Installable Day!

ASDF-Install is a package management system that fetches packages from cliki.net and installs them on your local machine.

It has two essential features:

  • A single command will download and install a package from the web.
  • It will download dependencies automatically, if they too are ASDF-Installable.

In addition, it will verify PGP signatures of the files downloaded before installing. This provides some safety over what you are downloading.

But not all Common Lisp software uses this system. How can you tell if a package is ASDF-Installable? There are two requirements:

  1. It has a cliki.net page named after the package name.
  2. The cliki.net page has an ASDF-Install compatible link.

The graphic below shows these two things. Click on it to see a larger version.
ASDF-Install link small

Everyone knows of one or two packages that are not ASDF-Installable. And that can get annoying, especially when you want to release your package as ASDF-Installable.

What I propose is that on Tuesday, everyone finds one package that is not ASDF-Installable and makes it so.

Here are the steps:

  1. If it’s your package, go on to step 2. If it’s not your package, get permission from the authors.
    • Email the author of the package and ask if you can help him/her make their package installable.
    • Motivate them by explaining the benefits of ASDF-Install.
    • This is important when working with other people’s creations. People have worked hard on their software, and they have the right to determine how it is distributed.
  2. Read and follow the instructions to create the necessary files.
    • Create an ASDF package definition.
    • Package everything up in a tar.gz archive.
    • Generate a signature.
  3. Upload them to a web server.
  4. Create or edit the cliki page.
    • And put in it an ASDF package directive.

It’s that easy!

Remember, keep the creator in the loop.

When you’ve finished, post a comment about it! Good luck!

Popularity: 2% [?]

One Laptop Per Child

November 12th, 2007

I just ordered my XO Laptop today.

The One Laptop Per Child project is a charitable organization which seeks to put technology in the hands of children in developing nations. Here’s an excerpt from an email I got this morning:

Today marks the first day of our limited-time “Give One Get One” program. Starting today, when you donate an XO laptop to a child in the developing world, you’ll receive one for the child in your life. The price for the two laptops will be $399, $200 of which is tax-deductible. Additionally, T-Mobile is offering donors one year of complimentary access to T-Mobile HotSpot locations throughout the United States, which can be used from any Wi-Fi-capable device, including the XO laptop.

Please visit www.laptopgiving.org to participate in Give One Get One and discover more about the revolutionary XO laptop. You can also donate by calling toll-free 1-877-70-LAPTOP (1-877-705-2786). This is the only time we’re making the XO laptop available to the public and quantities are limited, so early purchasers have a better chance of receiving their XO laptops by the holidays.

It will probably take a while to get here, but I feel good that I’m doing something for the education of the developing world. I can’t wait to try it out. It is durable, has an excellent antenna, and great battery life.

It comes with Etoys (Smalltalk), Scratch (a graphical programming language) and Pippy (Python), which are programming learning environments aimed at kids. It’s running Linux, so I hope to get Common Lisp running on it, and to make it my travel computer.

Consider buying an XO. It could make a huge difference in the life of a child who doesn’t have access to textbooks. The laptop will open up opportunities in so many ways: access to the web, chatting and collaborating with students around the world, and using it as a tool for scientific experimentation.

Popularity: 2% [?]

Time window matcher

October 25th, 2007

Well, I did it: I succumbed to the allure and challenge of someone who posted a Ruby quiz on Usenet:

this is ruby quiz 144, anybody feel like doing it in CL?

Time Window (#144)

by Brian Candler

Write a Ruby class which can tell you whether the current time (or any
given time) is within a particular “time window”. Time windows are
defined by strings in the following format:

ruby
# 0700-0900 # every day between these times
# Sat Sun # all day Sat and Sun, no other times
# Sat Sun 0700-0900 # 0700-0900 on Sat and Sun only
# Mon-Fri 0700-0900 # 0700-0900 on Monday to Friday only
# Mon-Fri 0700-0900; Sat Sun # ditto plus all day Sat and Sun
# Fri-Mon 0700-0900 # 0700-0900 on Fri Sat Sun Mon
# Sat 0700-0800; Sun 0800-0900 # 0700-0800 on Sat, plus 0800-0900 on Sun

I was intrigued. So I did it. It’s a bit messy, as these things usually go, but it passes all the unit tests. I did it first in a Lispy way, by making it sexpression instead of strings, then I tacked a string parser on top of it.

You can find the code here: Ruy Quiz #144 Solved in Common Lisp . It requires lisp-unit, cl-utilities, cl-ppcre, and s-utils.

[edit: a new version is available, which I describe a bit here]

Please feel free to comment. I’d love feedback.

One of the things I love about doing these things is that you get a nice set of new utility functions when I refactor them. Sometimes I feel like if it didn’t require so many lines of code, then there’s nothing I really gain from it, besides the main function I write.

Here are some of the utility goodies I made:

  • scan-and-bind macro, which binds variables from a regex match
  • make-time function, which has the parameters of encode-universal-time reversed with default values
  • (so I can write (make-time 2007 10 24) instead of (encode-universal-time 0 0 0 24 10 2007))
  • hour-of and minute-of which give the hour and minute, respectively, from a universal time
  • other minor functions. Check out the source if you want to find out more

I like these kinds of challenges. They help me grow as a programmer. And I think that fun competition between languages is healthy for all languages involved. One of the reasons I decided to take the challenge is that I feel like Common Lisp is challenged a lot by people who don’t understand it. I don’t know if this is the case for this particular post, but usually what ends up happening is that the challenge is easily solved in CL, then a lengthy argument ensues about how it wasn’t done correctly or whether it can be done in fewer lines of code in another language.

This pains me, because there are a lot of claims that Lisp dialects have many advantages over other languages. And many popular languages claim to have been inspired by Lisp. The question I think that comes to mind is: “if Lisp is so great, why hasn’t it been proven after so many challenges?”

Well, I’m not sure about this (and I’d love your comments) but I think one reason is that the Common Lisp community doesn’t challenge other language communities. Common Lisp is good at a lot of things. If we find those things it’s best at, and showed those things to the world, I bet people will understand. For instance, I believe that while other languages create mini-languages in character strings, in Common Lisp, we do it in the language itself, which might be hard to understand if you haven’t done it before.

By taking a proactive position, we might show that we are up for the challenge

So, right now, I’m looking for a challenge to post to the comp.lang.ruby newsgroup. I want one that will rattle them to the bone about the inadequacy of their language. Nothing big, just a whopper to get them thinking. Do you have any ideas? Let’s give them something to talk about.

Popularity: 2% [?]