Live data from Hacker News

CL or Scheme?

news.ycombinator.com

11–20 of 47 posts

Re: CL or Scheme?

#11
I like CL, though if there were a book called Common Lisp: The Good Parts a la Crockford, it would probably describe the subset I like to code in (at least as long as I got to add LOOP.) In other words, CL is huge and there are large parts of it you need never use. I guess the intricacies you mention are annoying, but somehow those things never bothered me (e.g. I'm fine with CAR and CDR; they're short and symmetrical). I'd say Scheme is better for exploring ideas and CL is better for getting things done, so it depends on what you want. PCL targets CL, of course, so if you like the book and have gotten over the painful Emacs setup hurdle you may as well stick with it.

newLISP isn't based on CL or Scheme, it's its own weird thing that is regarded as leprotic by the rest of the Lisp community.

Re: CL or Scheme?

#12
I really value long term quality of my code and I highly value simplicity and pretty looking code. In these regards Scheme is a much better choice.

There may be some libs that are in CL but not Scheme, but I actually have found nearly everything in Scheme that is in CL. Although some common real world problems are better addressed in CL related documentation.

...And you really only need emacs (or Vim, etc) and CL, Scheme, whatever installed. Setting up SLIME and all that isn't necessary to get started.

Re: CL or Scheme?

#13
post #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.

> LET* indicates bad code, something I never understood

Neither did I, until I encountered something along the lines of:

    (let* ((foo ...)

           (foo ...)

           (foo ...)

           (foo ...)

           (foo ...)

           (foo ...)

           (foo ...))

        ...)

Re: CL or Scheme?

#14
post #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.

Setting up SBCL+Emacs+SLIME is really easy if you use Ubuntu or some other distro that contains packages for them. All you need to do in current Ubuntu is

    $ sudo apt-get install sbcl emacs slime && echo "(require 'slime)" >> ~/.emacs
and then start emacs and press Alt+x, write `slime´ and press enter (M-x slime for the initiated).

Now using all the available features of that combination will take a lot of time, but starting isn't really hard.

Re: CL or Scheme?

#15
post #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.

Well, maybe 'very different' was an overstatement =).

One way to look at it is that we should use single-use functions as far as possible to keep code straightforward.

And as jpr said, LET* can potentially promote bad style, giving one the inclination to mix functional and imperative styles in a potentially troublesome fashion.

I think it was in 'On Lisp' that PG said that use of LET* should be minimised for the reasons above.

But if not, you're right. Use LET* just as you mentioned, but don't use LET* for all cases.

Some discussion available @ Stack Overflow: http://stackoverflow.com/questions/554949/let-versus-let-in-...

Re: CL or Scheme?

#16
Few months ago I was where you were, just a bit less confused. I liked different names for different things (flet vs. labels, for example), the language comes built-in with useful data-structures and functions (e.g., hash-tables; which one do you use in Scheme), documentation about stuff (hyperspec) is 3 keystrokes away in SLIME, and most of the book on macros (which are said to be LISP's main strength) are written for CL. Few days ago, I've seen a monads package written for common lisp using macros. Like, WOW!

I have also tried Racket, and I was kinda disappointed. Nothing that I could particularly point my finger on, but.. it had that feeling of being a "toy".

Yes, it might also be a personality preference. I'm the kind of person that prefers Perl over Python.

Re: CL or Scheme?

#17
newLISP is a scripting language with a Lisp-like syntax. It's designed to be a Lisp-flavoured alternative to Perl or PHP or AppleScript. The emphasis is on staying small (250Kb) and easy to install, learn, and use. As a non-programmer I'm not clever enough to learn CL or Clojure, but I found newLISP pretty easy to learn and use for day-to-day scripting tasks and CGI work.

It's based on the ideas of Lisp, rather than on anything more concrete. I've been able to glimpse some of the elegance that Lisp users are familiar with. It shares some Lisp DNA (hence the name), but the author's focus on code size and ease of use has moved it away from mainstream Lisp developments. It won't (and doesn't) appeal to everyone, and wouldn't be suitable for all projects, but I've found it a useful tool to have in my toolbox. At least, it helps me get my work done and I've had some fun with it too, which can't be a bad thing, can it?

Re: CL or Scheme?

#18
First of all both Common Lisp and Scheme are excellent languages with impressive implementations to choose between. Furthermore if you learn one of them, you'll be able to learn the other one in no time.

Instead of comparing languages, I'd suggest you pick between implementations. This suggestion might seem odd, but the Scheme standard (R*RS) is very minimal, which imply that all major Scheme implementations contain many, many libraries and language construct not mentioned in the standard.

I my self is a Racket user, which of course makes my view biased. Here are some of the reasons Racket is the perfect choice for me:

   - programs runs on Windows, OS X and Linux 
     with no source changes

   - the installation is pain free

   - the documentation of the language and libraries 
     are in a league of its own 
     (http://docs.racket-lang.org/)
     [that said, the Common Lisp spec is also very good]

   - the language is clean with a very good module system
     that supports macros the right way (IMO)

   - the community is very helpful (ask if there is a
     library/construct/feature you can't find 
     --- odds are you the wrong place)

Re: CL or Scheme?

#19
post #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 wh…

I'm like the OP in that I've set up the environment and am up to Ch 12 in Practical Common Lisp. Plus it finally motivated me to learn emacs after a couple of decades of vim. The extract from the Land of Lisp makes me think I might enjoy Scheme more, since I'm just learning Lisp at home for fun.

Can you recommend a particular online learning resource? I've had a quick look at MIT's videos of their lecture series, but I've just run out of spare disk space on the laptop, so storing a few GBs of movie is out for the moment. If there's something like PCL for Scheme, that would be great.

Re: CL or Scheme?

#20

newLISP is a scripting language with a Lisp-like syntax. It's designed to be a Lisp-flavoured alternative to Perl or PHP or AppleScript. The emphasis is on staying small (250Kb) and easy to install, learn, and use. As a non-programmer I'm not clever enough to learn CL or Clojure, but I found newLISP pretty easy to learn and use for day-to-day scripting tasks and CGI work. It's based on the ideas of Lisp, rather than…

If anyone's considering picking up newLISP, be advised they made some widely criticized design decisions (such as omitting lexical scope, closures, pass by reference, and GC) intended to speed up the interpreter. Last I heard, they don't plan on having a compiler.

http://arclanguage.org/item?id=2911

Post reply on HN