My hopes about Arc

August 31, 2005

I’ve been meaning to write about my expectations for Paul Graham’s Arc and I’ve decided to take the time tonight to do it.

Language

About Arc, the language, I hope that it retains the cool flavor from Lisp while bringing forth new, fresh things. Having syntax for some of the common idioms seems like a good idea to me. I like the [+ _ 1] form for a lambda expression of one argument (this would translate to: (fn (x) (+ x 1)) ). Another thing that seems nice is the array syntax. In Common Lisp, to get the nth element of an array, you’d use the aref function. Paul wants to make it possible to say something like (arr 2) to get the third (or second, I’m not sure if his arrays are 1-indexed. I’m pretty sure they aren’t) element off the variable array. I guess that means making arrays closures. That could look something like the following (in Scheme):

(define (make-array vec)
  (lambda (n)
    (vector-ref vec n)))

(define arr (make-array #(1 2 3 4 5)))
(arr 3) ; Returns 4

That would definitly be something nice. Three of the four loops are, but I can’t understand why he put in for, which is pretty much exactly like C languages. I would’ve prefered Common Lisp’s infamous loop facility, but Paul hates it, so I wouldn’t count on it.

Implementation

I’m not a compiler writer, so I don’t know much about implementing a language, but I hope Arc’s implementation is not written completely in C like Python, Perl and Ruby. I hope it will be more like Factor, SBCL or Squeak, something self-hosted. I don’t particularily care if it’s a native compiler or built on a VM, but as long as C is not predominant in Arc, I’ll be happy.

Other than the compiler, I hope that Arc has the following: a good profiler, a good debugger, an interactive REPL, a good Emacs mode, a documentation tool (sort of like RDoc) and a tool to install Arc software (like RubyGems)

Libraries

When Arc is released, it will probably attract a lot of curious developers. If it wishes to keep them, I think it should be practical from the beginning, not just a “Oh it’s nice, but I can’t write anything with it yet” language. Libraries are often what keeps developers around, just look at CPAN and how some people refuse to move away from Perl because of it. Therefore, I think Arc should have the following libraries: regular expressions, net libraries (http, ftp, smtp, etc.), XML processing, file system interaction (files and directories). Of course, other libraries are needed to make a language very popular, but I believe those would definitly help Arc.


Did I make a DSL?

August 30, 2005

I’ve been reading a lot of nice stuff about DSLs lately, and I think it’s a very nice way to create software. I looked at a piece of software I wrote before I started learning about DSLs in more detail, and I was wondering if I had created a small DSL for my problem.

My Ruby library, ShortURL (available through RubyGems) has a Service class to use URL shortening services. So defining a new service is pretty straight-forward:

shiturl = Service.new("shiturl.com") { |s|
      s.method = :get
      s.action = "/make.php"
      s.block = lambda { |body| URI.extract(body).grep(/shiturl/)[0] }
}

Then, to shorten an URL, you’d just use the #call method: shiturl.call("http://gnuvince.net"). I was wondering if this (very simple) solution qualifies as a DSL? Thanks for the input!

Edit: for some reason, when I put code between <pre> tags, it adds backslashes before double quotes. Go figure why.


Oh, what a sad departure…

August 30, 2005

I was looking at the things I need to do at work today, and one of the things is to reformat the computer of a user because she’s going back to university. That’s too bad, because that girl had eyes that could make you dream: they were gray-silver. Very, very nice girl, quite cute. She’ll be missed. I guess I’ll need to stalk someone else now.


Movie night

August 27, 2005

Last night, I went over to Peej’s and Etien’s to watch Sin City. They hadn’t seen it and I was eager to watch it again, so we gathered at their place with a big bowl of pop corn and some alcohol. They had a blast, they thought the movie was excellent, Etien is even considering buy it. Too bad Seb missed it; he didn’t want to come because for some reason he doesn’t want to see any movie that is an adaptation of a comic book and he doesn’t like Rodriguez’s films. Well, all I can say is that he missed quite a movie. Don’t judge a movie before you’ve seen it.


Emacs everywhere!

August 26, 2005

Wow, I’m using Emacs everywhere, it’s crazy! When I’m at work, I connect home with putty to browse some sites and do some IRC. I now use Emacs’s ERC IRC Client and the w3m mode for Emacs for these two tasks. And they’re really swell clients too, because I can customize them as much as I want, I just need to write the needed elisp code. Yay for Emacs!


Another bad thing about gizmo on Linux

August 26, 2005

Seb made me notice another problem with the Linux version of Gizmo:

nce@vincent: ~]% du debug.file
2.7G    debug.file
[vince@vincent: ~]%

Nice, and I’ve used Gizmo for only a couple of hours Tuesday or Wednesday. It’s a bit excessive, don’t you think? Go Skype, Go!


Fun republican quotes from Clinton’s era

August 25, 2005

Go read what the Republicans had to say about Bosnia. Interesting how they don’t repeat these same messages with Iraq.

I think this deserves a nice picture.


Gizmo on Linux: disappointing

August 24, 2005

Seb and I gave Gizmo Project on Linux a try today. We’re “terribly” impressed </sarcasm>; like Seb put it, it “works”. It’s very disappointing, it’s as if they just botched a lot of things just to finally get a Linux version out and compete with Skype. Here are some of my beefs with it:

  • Packages: you have the choice between a Linspire package and a Debian package (marked alpha). There are no RPMs, no tar archive so this penalizes users using distributions that aren’t built on Debian or that are Linspire.
  • Bonjour: When I tried to install the SIPPhone library, a Debian package, it said that it couldn’t because of a failed dependency: bonjour. I knew bonjour was an Apple technology, but since it said that it was missing a Debian dependency, I assumed that I would find a package to apt-get. I was wrong, nothing in my sources.list and nothing on apt-get.org. So I had to go to the Apple’s Developers site, find the Bonjour package, log in (I am already a member, but this may be a drag for non-members), download it, compile it and copy the required .so file to /usr/lib/. I could then install SIPPhone using the –force-depends option and then the gizmo package.
  • Stability: Not too hot in that department, in 10 minutes I managed to crash Gizmo twice, Seb was once hung at the login screen and Gizmo froze when I tried to call him. We were able to talk when we went in a public conference.
  • Features: The Linux version of Gizmo Project has no preference pannel, and there’s nothing in the “Home”, “Calls” and “Conferences” tabs. Also, the cool sounds you can play to annoy everyone in a conference are nowhere to be found.
  • Weird behaviour: clicking the phone pad icon at the bottom of the application resizes the application and doesn’t give you a phone pad

Like I said, very incomplete, very unsatisfactory. These guys should’ve kept on working on their release because right now it sucks, it doesn’t make me want to use Gizmo at all and I will be reticent to try newer versions because of my initial disappointing experience.

Final grade: F


Nicest Ruby indentation I’ve seen

August 24, 2005

Check out this little gem, notice how nicely indented it is:

  • The leading indenting for the first code line
  • The really far out @dropdown.addItem lines
  • The if/elsif/else which uses three different tab width (8 for the then clause, 4 for the elsif clause and none for the else clause)

Ain’t it nice? I’m sure this could cause an advanced Rubyist to go blind!


Today’s Dilbert

August 23, 2005

It’s a known fact that you should never let the technical people decide which technologies they should use for a particular problem. I mean, that’s just crazy! They work with that stuff all day, what do they really know? No, it’s best to leave technological decisions in the hand of someone who has a much broader view of the implications of the choice of a technology, someone for instance who can’t remember how to fetch his email.