Live data from Hacker News

Ask HN: I want to start learning Lisp. Where do I begin?

news.ycombinator.com

101–110 of 211 posts

Re: Ask HN: I want to start learning Lisp. Where do I begin?

#101
Haven't seen it mentioned, Paradigms of AI Programming by Peter Norvig is another good introduction to Common Lisp. It focuses on classic AI algorithms which showcase the strengths of the language well. It's available online here https://github.com/norvig/paip-lisp

Re: Ask HN: I want to start learning Lisp. Where do I begin?

#104
I don't know what it is about ANSI Common Lisp but it wasn't just a good introduction to something technical, it was fun. I blasted through it in a couple days. I never do that. I usually can't wait to ditch whatever introductory text I'm using and get off the beaten path but I couldn't put it down.

Re: Ask HN: I want to start learning Lisp. Where do I begin?

#105
Probably the best way to get started just to install SBCL and start typing stuff in at the REPL. Lisp is a very immediate language; you can type an expression in and the REPL will instantly evaluate it and show you the results. Many other languages, such as Python, Ruby, and JavaScript, actually borrowed this feature from Lisp.

You're going to need an editor to write long-form programs. Vim and Visual Studio Code are fine, but the ne plus ultra of Lisp editors is Emacs ( https://www.gnu.org/software/emacs ). Emacs comes with an excellent Vim-emulation mode, so if you cannot leave behind your vi muscle memory, that's always available to you. Another feature of Emacs is, it contains, and much of it is written in, its own dialect of Lisp! The upshot of this is you can usefully extend and customize your editor by evaluating a few Lisp expressions. Playing with Emacs Lisp is a great way to learn how to use the language to do "real work" during your experimentation. Emacs has a package available called SLIME, which allows it to talk to a standalone Lisp environment such as SBCL, send it expressions to evaluate, and get results. SLIME also has LSP-like features to show documentation on the Lisp functions you've defined. Vim and Visual Studio Code can speak SLIME's protocol with the proper add-ons, but the integration is not as tight as with Emacs.

If Lisp seems overwhelming, it's because it's more of an idea than a specific language. There are three varieties of Lisp you should be aware of. Well, four if you count Emacs Lisp, but the standalone ones are:

* Common Lisp

* Scheme

* Clojure

Of these, the best place to start is probably Common Lisp. It is a comprehensive language which has been used in real-world software engineering projects since the 1980s, and it has a very strong community surrounding it. There are a few implementations, both open source and proprietary. The most favored one today is SBCL: https://www.sbcl.org

Scheme is much simpler. It is more of a language core used for teaching, and for providing a basis for a more feature-rich programming language. There are many implementations, most of which provide their own extensions to the core language; my favorite for getting work done in a Unix-like environment is GNU Guile: https://www.gnu.org/software/guile

Clojure is a language that is designed to interoperate well with the JVM, and to promote Rich Hickey's ideas on functional programming. It is a very opinionated language, more so than the other two, and you may find yourself struggling more if you don't do things the Clojure way. Personally, I like it less than the other two, but that's a matter of taste and you may find it more useful.

Over time I hope you will have the opportunity to try all three. Each has something different to offer and each can be learned from.

Re: Ask HN: I want to start learning Lisp. Where do I begin?

#106
post #84

Racket Scheme & SICP is a fun way to start playing, especially if you are into theoretical concepts of CS and programming, like higher order programming and abstraction. The documentation for Racket is excellent, see e.g. https://docs.racket-lang.org/quick/index.html ... and many people have created online resources to adapt SICP to Racket, as well as other learning texts. I like Beautiful Racket, e.g. https://beauti…

Can I read SICP while learning Clojure? Is lisp very different?

> Can I read SICP while learning Clojure? Is lisp very different?

Clojure is Lisp!!! with some nice out of the box semantics like immutability.

Re: Ask HN: I want to start learning Lisp. Where do I begin?

#107

There are a lot of classics such as SICP and The Little Schemer, and I dearly love them all and consider them all to be canon that everybody should read at least twice. But, for an easy/fun on-ramp, I think that there are three new contenders that are much better for getting a feel for things. Pick one according to your tastes, or burn through them all in a couple weekends and then decide. If "functional programming…

Realm of Racket doesn't teach you about metaprogramming though.

Re: Ask HN: I want to start learning Lisp. Where do I begin?

#108
post #75

If you want to learn a LISP dialect just for fun and/or enlightenment, I would say you want either a Scheme (Guile or Racket) or Clojure. Some people will argue that Clojure isn't a real LISP, which is fine. They're probably right. But it's an elegant and well-designed language that has a lot of the same features and feeling of a LISP/Scheme. I know I could be burned alive for saying it, but Common Lisp is pretty ugl…

Why is common lisp ugly? Many people here suggested common lisp. I was considering it. I like to learn for fun but I am looking for something practical. I will want to build some useful apps in the end with it.

I wouldn't call it ugly, more. . . untidy.

Common Lisp grew by accretion over a fairly long span of time. Consequently, it has varying conventions, inconsistent ways of working, and a whole lot of TMTOWTDI going on.

That said, perhaps we should be careful what kind of house we're in before throwing stones. Exactly the same accusation could be leveled against Java, Python, C++, and Haskell.

Re: Ask HN: I want to start learning Lisp. Where do I begin?

#110
post #84

Racket Scheme & SICP is a fun way to start playing, especially if you are into theoretical concepts of CS and programming, like higher order programming and abstraction. The documentation for Racket is excellent, see e.g. https://docs.racket-lang.org/quick/index.html ... and many people have created online resources to adapt SICP to Racket, as well as other learning texts. I like Beautiful Racket, e.g. https://beauti…

Can I read SICP while learning Clojure? Is lisp very different?

There are a few people who have translated the solutions to Clojure, this one looks like the most comprehensive: http://www.sicpdistilled.com/
Post reply on HN