Live data from Hacker News

CL or Scheme?

news.ycombinator.com

1–10 of 47 posts

CL or Scheme?

#1
I started reading Practical Common Lisp. It took me two whole days to setup a CL system: Emacs, SLIME, CLISP, Quicklisp. The syntax is riddled with intricacies: LET or LET* or FLET or LABLES? Is Scheme (esp. Racket) any better?

Also, is newLISP based on CL, Scheme, or something else? I've had zero difficulty installing and coding it.

Re: CL or Scheme?

#2
Racket is very easy to get going with, you just install it and use the IDE, which gives you the text editor/code area and REPL together like emacs/slime. Scheme is a smaller language. For example, there is no flet/labels, you just use (define) for nested functions. It's a good way to get going with a Lisp and see if you want to take on a heavier language like CL or Clojure.

Re: CL or Scheme?

#3
Depends on what you want to use it for.

If you want to create powerful, intricate production apps, you're probably better off with CL. It's got better libraries, a bigger community, and more history.

If, on the other hand, you're interested in learning Lisp for the purity, the "aha" moments, and to become a better programmer, I'd have to recommend Scheme. It's a lot simpler, more self-consistent, with an order of magnitude less confusing bits and "gotchas". But it's still every bit as good at showing why Lisp is awesome.

And, of course, I must mention Clojure, which aside from the JVM cruft is much "cleaner" than CL, but just as powerful and ready for production use. It's also even more intensely focused on functional programming than Scheme OR CL.

Re: CL or Scheme?

#4
I'd say Common Lisp is the superior choice.

In terms of the availability of support libraries and what not, you'll find it easier with Common Lisp. Quicklisp would be the most recent (and awesome) tool that comes to mind.

In terms of the language itself, it's just more complete to me.

LET and LET* have very different uses, and while ugly, LABELS has helped me quite a fair bit, especially in porting over some recursive Haskell code.

Oh, and don't forget the wonders of LOOP =)

Other than that, I can't speak for Racket, nor any of the other Lisps out there. So take by biased opinion as a CL user for what its worth.

Re: CL or Scheme?

#5
I'm a huge fan of Scheme. Not so much because of the language itself as for its ubiquity. You can find a Scheme interpreter for almost any platform, and for those that don't have one yet, it's actually tractable to implement an interpreter yourself (in some other language).

It's also a very elegant and beautiful language. At the end of the day, though, your customers care whether your product is beautiful, less so whether the code is beautiful.

I've never used CL.

Re: CL or Scheme?

#6
One could also argue that once you have Emacs set up, you have enough to learn Lisp. Use ielm mode as a REPL, or lisp-mode for longer code bits. Sure you don't get lexical scope standard, but more than enough to muck around... The elisp info page built in is a fine reference.

Re: CL or Scheme?

#7
Unless you plan to switch your projects to a Lisp (by which I mean a general name for CL or Scheme) right away, I would recommend the following route:

1. Start with PLT Scheme/Racket. It's self contained, very well supported on all platforms, and Scheme is a leaner and cleaner language that will cause you less confusion in the beginning. This platform should be enough for you to learn Lisp and be enlightened by its idioms.

2. If in the future you plan to get serious with Lisp and write real projects in it, reconsider. You will have much more familiarity with the eco-system by then. Scheme vs. Common Lisp is a religious war of epic (= brace style) proportions, and it's not wise to get confused by it right when you start.

Re: CL or Scheme?

#8
A little off topic, but I notice a lot of people new to Emacs and Lisp banging there heads trying to get Slime set up and running, when Emacs has excellent Lisp support right out of the box. Slime is excellent, but complicated (even by Emacs standards). I wouldn't recommend a user installing it until a specific need arises. I can't imagine trying to learn Lisp, Emacs, and set up Slime all at once.

Re: CL or Scheme?

#9
I just started reading Land of Lisp today, and the first chapter has exactly this discussion. Hope Conrad Barski, the author and HN reader, doesn't mind if I repost the excerpt here.

Land of Lisp, ps 16-17:

http://landoflisp.com/

"A Tale of Two Lisps

Some deep philosophical differences exist between ANSI Common Lisp and Scheme, and they appeal to different programmer personalities. Once you learn more about Lisp languages, you can decide which dialect you prefer. There is no right or wrong choice.

To aid you in your decision, I have created the following personality test for you:

A. (drawing of a mean looking wolf)

B. (drawing of a tranquil sheep)

C. (drawing of the wolf in the sheep's clothing)

If you chose A, you like raw power in your language. You don’t mind if your language is a bit ugly, due to a lot of pragmatic compromises, as long as you can still write tight code. ANSI Common Lisp is the best language for you! ANSI Common Lisp traces its ancestry most directly from the ancient Lisp dialects, built on top of millions of programmer hours, giving it incredibly rich functionality. Sure, it has some baroque function names due to countless historical accidents, but this Lisp can really fly in the right hacker’s hands.

If you chose B, you like languages that are clean and elegant. You are more interested in fundamental programming problems and are happy to while away on a beautiful meadow, contemplating the beauty of your code, occasionally writing a research paper on theoretical computing problems. Scheme is the language for you! It was created in the mid-1970s by Guy L. Steele and Gerald Jay Sussman and involved some soul-searching about the ideal Lisp. Code in Scheme tends to be slightly more verbose, since Schemers care more about mathematical purity in their code than creating the shortest programs possible.

If you chose C, you’re someone who wants it all: the power of ANSI CL and the mathematical beauty of Scheme. At this time, no Lisp dialect completely fits the bill, but that could change in the future. One language that might work for you (although it is sacrilege to make this claim in a Lisp book) is Haskell. It is not considered a Lisp dialect, but its followers obey paradigms popular among Lispers, such as keeping the syntax uniform, supporting native lists, and relying heavily on higher-order functions. More important, it has an extreme mathematical rigor (even more so than Scheme) that allows it to hide very powerful functionality under a squeaky clean surface. It’s essentially a wolf in sheep’s clothing. Like Lisp, Haskell is a language that any programmer would benefit from investigating further.

Up-and-Coming Lisps

As just mentioned, there really isn’t a true Lisp dialect available yet that possesses both the power and flexibility of ANSI Common Lisp and the elegance of Scheme. However, some new contenders on the horizon may attain the best-of-both-worlds crown in the near future.

One new Lisp that is showing promise is Clojure, a dialect developed by Rich Hickey. Clojure is built on the Java platform, allowing it to leverage a lot of mature Java libraries right out of the box. Also, Clojure contains some clever and well-thought-out features to ease multithreaded programming, which makes it a useful tool for programming seemingly ubiquitous multicore CPUs.

Another interesting challenger is Arc. It is a true Lisp language being principally developed by Paul Graham, a well-known Lisper. Arc is still in an early stage of development, and opinion varies widely on how much of an improvement it is over other Lisps. Also, its development has been progressing at a glacially slow pace. It will be a while before anyone can say if Arc might be a meaningful contender.

We’ll be dipping our toes in some Arc and Clojure in the epilogue."

Re: CL or Scheme?

#10

I'd say Common Lisp is the superior choice. In terms of the availability of support libraries and what not, you'll find it easier with Common Lisp. Quicklisp would be the most recent (and awesome) tool that comes to mind. In terms of the language itself, it's just more complete to me. LET and LET* have very different uses, and while ugly, LABELS has helped me quite a fair bit, especially in porting over some recursiv…

Why do you say LET and LET* have very different uses? I just use LET* if I need to reference a preceding variable in the same declaration (it happens). Actually I vaguely remember PG in one of his Lisp books saying LET* indicates bad code, something I never understood, though empirically I've noticed some evidence for it.
Post reply on HN