News for hackers. Stuff that matters.
Re:Ask HN: I want to start learning Lisp. Where do I begin? by pixelmonkey on Wednesday December 16, 2020 @08:05AM (#25442005)
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://beautifulracket.com/explainer/lists.html

You can use #lang sicp and start playing around with the free online reformatted SICP text here:

http://sarabander.github.io/sicp/

I recommend getting a print copy of SICP, though, and working through the examples in a real DrRacket environment on your computer.

IMO, if you end up going deep in the "lispy" direction after playing with Racket, you'll probably be drawn to Clojure as it is the Lisp with the biggest "production use" community at the moment. So long as you can put up with some JVM warts, it, too, will be a good experience.

Re:Ask HN: I want to start learning Lisp. Where do I begin? by masukomi on Wednesday December 16, 2020 @11:25AM (#25444422)
I have to second this. Racket is absolutely the best place to start. There are great books for beginners, and the documentation is top notch.

it comes with its own editor (Dr. Racket) that does some really helpful things for beginners, like hovering over a variable and seeing lines drawn to where it's being used.

It's not the fastest lisp, but that's ok. It's spectacular for learning and has a huge ecosystem too. My "daily driver" is Chicken Scheme, but i wouldn't recommend it to a beginner. The docs just aren't helpful to newbs (and frequently frustrating to me even though it has one of the better set of docs)

Vim is meh for Lisp & Scheme, and I'm a Vim fan. Emacs is great. If you're a Vim user check out Doom Emacs. It's great for us geeks who love vim but want more power and better lisp support. But... start with Dr. Racket for now.

Others have mentioned the SICP book, and it is good but i wouldn't suggest it as as "how to start with lisp" book. Also, watch the free lectures of the course from MIT. Very good, and make it way easier to work through the book.

Re:Ask HN: I want to start learning Lisp. Where do I begin? by Olical on Wednesday December 16, 2020 @11:35AM (#25444553)
I'm trying to make the neovim lisp world a little more pleasant with Conjure :) just for those that absolutely can not switch to emacs long term (like me)

https://github.com/Olical/conjure

It's written in a lisp, runs as lua and supports: Clojure, Fennel, Racket and Janet with a bunch more to come.

Re:Ask HN: I want to start learning Lisp. Where do I begin? by kls on Wednesday December 16, 2020 @09:58PM (#25451883)
Vim is meh for Lisp & Scheme, and I'm a Vim fan. Emacs is great. If you're a Vim user check out Doom Emacs.

There is always spacemacs: https://www.spacemacs.org/

Re:Ask HN: I want to start learning Lisp. Where do I begin? by estsauver on Wednesday December 16, 2020 @09:11AM (#25442629)
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.
Re:Ask HN: I want to start learning Lisp. Where do I begin? by tartoran on Wednesday December 16, 2020 @10:01AM (#25443321)
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? by slgeorge on Wednesday December 16, 2020 @12:08PM (#25445032)
ClojureScript which targets JavaScript as the host language (https://clojurescript.org/) is a good option on the Clojure side.

ClojureScript is great if you're drawn towards the "production use" side as pixelmonkey said and already have knowledge of the Javascript / Node ecosystem.

Re:Ask HN: I want to start learning Lisp. Where do I begin? by randombaseball on Wednesday December 16, 2020 @11:16AM (#25444309)
I'd like to add that there's also a large Discord community for Lispers here: https://discord.gg/eHectVPqJ4
Re:Ask HN: I want to start learning Lisp. Where do I begin? by coold on Wednesday December 16, 2020 @10:03AM (#25443350)
Can I read SICP while learning Clojure? Is lisp very different?
Re:Ask HN: I want to start learning Lisp. Where do I begin? by db48x on Wednesday December 16, 2020 @10:49AM (#25443972)
I wouldn't, unless you already know Scheme well. Otherwise, you're essentially learning two programming languages at once, and you won't know if your mistakes are because you misunderstand Scheme, Clojure, or both.
Re:Ask HN: I want to start learning Lisp. Where do I begin? by toby on Wednesday December 16, 2020 @10:47AM (#25443951)
There are a few people who have translated the solutions to Clojure, this one looks like the most comprehensive: http://www.sicpdistilled.com/
Re:Ask HN: I want to start learning Lisp. Where do I begin? by WillPostForFood on Wednesday December 16, 2020 @11:10AM (#25444229)
It looks like only chapter 1 is completed. A lot of chapter 2, and the just bits of 3 and 4.
Re:Ask HN: I want to start learning Lisp. Where do I begin? by zelphirkalt on Wednesday December 16, 2020 @11:36AM (#25444575)
Not sure Clojure can do all the recursion stuff (TCO), which would be good to have in a language, when working through SICP exercises. I would not recommend it for SICP. Better start with a Scheme, to have the least amount of friction.
Re:Ask HN: I want to start learning Lisp. Where do I begin? by fulafel on Thursday December 17, 2020 @01:05AM (#25453059)
You can trivially use recur for self-recursion: call (recur x) instead of (my-fn x) inside your function.

(There's also trampoline for mutual recursion cases)

Re:Ask HN: I want to start learning Lisp. Where do I begin? by zelphirkalt on Thursday December 17, 2020 @04:14AM (#25453935)
Is trampolining automatic, or does it have its own syntax as well?

Even a little thing like (recur ...) could be a tiny amount of friction. But good to read, that the usual cases are apparently handled well in the language.

Re:Ask HN: I want to start learning Lisp. Where do I begin? by fulafel on Thursday December 17, 2020 @11:25AM (#25457009)
The builtin helper function is called trampoline, it's a higher order function that relies on the mutually recursive functions returning "trampolines" or closures that do the desired subsequent call.

The trampoline pattern is an old trick that can also be imlemented in other languages to avoid stack consumption in mutually recursive calls.

Re:Ask HN: I want to start learning Lisp. Where do I begin? by zelphirkalt on Friday December 18, 2020 @08:03PM (#25473983)
I know what trampolining does, thank you.

That's unfortunate, that it is an additional function call, which needs to be explicitly written out. I'd guess such is necessary ultimately, because of limitations of the JVM and its limitations regarding recursion.

Re:Ask HN: I want to start learning Lisp. Where do I begin? by palerdot on Wednesday December 16, 2020 @10:40AM (#25443842)
> Can I read SICP while learning Clojure? Is lisp very different?

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