Wednesday, June 04, 2008

Picking a CLOS Implementation to Play With

Being provoked into trying to learn a bit more about CLOS's method of multiple dispatch, and wanting to find an implementation, led me on this search path in a few spare minutes:

1. Search Google for CLOS

2. Click http://www.dreamsongs.com/CLOS.html, which is on the site of Richard Gabriel ("worse is better")

3. Click the intriguing title CLOS: Integrating Object-Oriented and Functional Programming

4. Read with interest on the first page the essence of multi methods:


A generic function, or polymorphic function as it is sometimes called, is one whose implementation depends on the types of its arguments. That is, the code that is executed for a particular set of arguments is mechanically determined by the types of the arguments.

In strictly functional languages, an operation is defined by a single, monolithic piece of code; any argument-type conditionality is expressed as code explicitly programmed in by the user. In contrast, the CLOS notion of generic functions supports automatic selection from among separately defined, typespecific implementational parts. Yet, from the client’s point of view, generic functions and traditional ordinary functions are called in the same way: The procedural abstraction barrier is still in force.


5. Start looking for implementations. Search reddit for "lisp implementations".

6. Click Common Lisp Implementations: A Survey.

7. The survey lists 11 Common Lisp implementations. Of these, only 5 are listed as available on the Unixes and Windows. Of those, only 3 do not have commercial licenses. Two of the remaining choices have weird names: Armed Bear Common Lisp, which does not look promising (its own home page says, under "Bugs", that "ABCL's CLOS is intolerably slow"), and Embedded Common Lisp (ECL). It's difficult to tell what immediately from Wikipedia or Google what kind of support has. But the remaining candidate, GNU clisp, appears to be in good standing, judging from the Wikipedia article (where it is claimed this is the platform Paul Graham used for Viaweb), and the Sourceforge stats which claim 100 downloads a day in the past week.

8. Find the Clisp site. Another Lisp site without an obvious Download link.

6 comments:

Anonymous said...

Have a look at SBCL(.org).

Xach said...

http://eval.apply.googlepages.com/guide.html is a pretty good, short CLOS guide.

Anonymous said...

I said it was interesting, not popular :-).

JFKBits said...

Anonymous: in my 60 minute search, I rejected SBCL and its ancestor Carnegie Mellon CL for what appeared to be poor support in Windows. I only have access to Windows right now, but that's not the only reason for the cross-platform criteria. I used cross-platform as a heuristic to gauge size of community and hence software quality and breadth.

All that said, do you find SBCL compelling over other implementations, or is it more a case of "first tried, worked OK, stuck with it"?

deinst said...

With Clisp, pretend you pushed the download button and look at the right side of the screen.

SBCL works fine on windows. I have not tried anything too complicated on windows, but it should be more than sufficient for learning.

However, both LispWorks and Allegro have free versions that will probably better support someone just learning. (I believe Allegro is what practical common lisp's LispBox provides)

JFKBits said...

deinst: You got me there. The "Get Clisp" on the right hand side is obvious enough, I agree. After having my attention drawn to it, we'll just say that the layout is functional but the form could be improved.

Thanks for the endorsements of SBCL, LispWorks and Allegro.