Live data from Hacker News

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

news.ycombinator.com

81–90 of 211 posts

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

#81
post #78
post #71

Earlier quoted context omitted.

> I feel like I'm in the minority in that I prefer to NOT learn things by just "diving in". I am much more successful when I start from the absolute fundamentals. A bit more off-topic, but this resonated with me. I too feel more comfortable when I start with the absolute fundamentals. When something does not work, knowing the fundamentals helps me to reason about why it does not work from the first principles. On sim…

Exactly. Though, to be fair, if someone says they want to learn LISP and then you tell them to learn Emacs... well, now they have TWO problems! xD I love and use Emacs. And I also, unsurprisingly, don't like or recommend that people start off with all of these "starter packs". But at the same time, if you don't already know Emacs and you want to learn LISP, I don't know what I'd recommend.

[deleted]

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

#82

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…

SICP is also a fantastic book because such a high percentage of all of the interview questions you'll be asked are represented there, but you end up really quite fundamentally understanding the solutions and I think that translates really well into the code people write in interviews.

I also recommend a milder version, a stepping stone, before jumping to SICP, Simply Scheme. The book is available online for free[0]

[0]:https://people.eecs.berkeley.edu/~bh/ssch1/showing.html

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

#83
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 for the enterprise" sounds good to you, read Clojure for the Brave and True.

If you're more interested in a truly mature language with a more academic community, read Land of Lisp.

If you're looking for a simple language that's easy to learn, or if metaprogramming is really your jam, read Realm of Racket.

As far as editors go, just start with whichever one you personally like best. They're all fine. I wouldn't bother spending much time worrying about that until after you've confirmed you want to stick with it.

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

#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?

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

#85
post #6

Is there a good argument against Clojure in this case? My impression is that it's a good lisp and you can get actual work done in it which is an advantage over some of the other options.

How is the VSCode support? I've only used IntelliJ + Cursive for Clojure and am quite spoiled. That's the only reason I might not recommend Clojure for a VSCode user. Now, if said user is interested in switching to Emacs or IntelliJ, I'd think it would be a perfect fit.

Nowadays, you can get VSCode support for Clojure pretty much out of the box with calva[1] extension working together with clj-kondo [2] almost without any configuration. It works great - I've switched over from Cursive and I'm not looking back.

[1] https://calva.io/ [2] https://github.com/borkdude/clj-kondo/blob/master/doc/editor...

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

#86
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 go so far as to describe Common Lisp as ugly but it's an old and fairly large language that carries a lot of baggage does a few things differently from modern languages and operating systems. Personally, I tried to learn Common Lisp 15 or so years ago and found it difficult to get the hang of how it works.

The Lisp that I eventually got into is Clojure. If you're familiar with either Java or JavaScript then that's what I'd advise looking at. The language itself is well designed and elegant and if you understand the platform that it's running on (JVM or JavaScript depending on which variant of Clojure you're using) then that's very helpful. For me, being able to add a dependency on basically any Java library and use it without too much hassle is brilliant but I'd still love the language even if that wasn't the case.

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

#88
Pardon my plugging my own book, but you can read it free online: https://leanpub.com/lovinglisp and checkout the GitHub repo with examples. There are much better Common Lisp books for a broad coverage of the language. My book is a short tutorial followed by many example programs. The book is released under a Creative Commons license so you can find copies on the web, but probably better to read the latest version online.

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

#89
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.

Caveat: I'm not an expert in any of it. I've played around with Guile Scheme, Common Lisp, and did a (small) real-world work project in Clojure.

I mean, Common Lisp is perfectly fine. And if you want to use it to write real apps, it's a good choice. Especially if you will have dependencies to manage (see quicklisp).

There's just a few little things that I don't like as much about it.

There's a holy war about "lisp-1 vs lisp-2 (or lisp-n, really)". Not much point in debating that, but scheme is a lisp-1 and CL is a lisp-2.

I like that schemes tend to use #f for false and #t for true, whereas CL just uses nil for false, and for empty-list, and anything else for true (which is usually the symbol t in practice).

I like the way things are named more in Schemes: map vs. mapcar, number? vs. numberp, etc.

I like that the Scheme standards guarantee tail-call-optimization. I believe all popular CL implementations do implement it, but it's not required by the standard.

CL has the ugly loop macro, and Schemes emphasize recursion more (also has `do`, though).

Schemes have "hygienic macros" which I like much more than unhygienic macros.

These things mostly don't matter, honestly. It's all bikeshedding. Lisps and Schemes are very very similar and also very different than most other languages. You can't go wrong with either.

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

#90

If you mean Common Lisp, I'd say install SBCL and start playing with with the repl. Choose the editor you know best; even notepad is useful to copy and paste expressions to/from the repl. Any editor that's suited for programming will have a way to send expressions to the repl with a keystroke, which is much more comfortable. So basically, just pick VSCode. With that, you're ready to go. Take just one book and work th…

SBCL is great, but one should not use an editor, which doesn't have proper paren matching and some indentation support. That is just making your life miserable. So SBCL+Slime+Emacs is a great combination. Or alternatively, get the free version of Lispworks.
Post reply on HN