Live data from Hacker News

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

news.ycombinator.com

41–50 of 211 posts

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

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

As a Lisp and Clojure beginner, ehhhh. I could get work done, but I depended on the terminal for REPL and compiling & running. I ended up using Emacs, which along with .NET were the only cases where VSCode didn't feel ideal for me.

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

#42
post #21

First you have to choose your flavor. If you want to use JVM, probably clojure. Otherwise Scheme, Common Lisp and Racket. Scheme is rather minimalistic, Common Lisp is very functional and Racket is the most modern one I guess. I ended up with Common Lisp and I rather don't look for change. SBCL is implementation I use and like it. Probably the best one and quite portable. Emacs seems the best choice for Lisp, since i…

Emacs is probably the best editor for Lisp, but we have other good choices nowadays (progress!!): SLIMA for Atom, 2 VSCode extensions, Vim of course, Jupyter notebooks, and more: https://lispcookbook.github.io/cl-cookbook/editor-support.ht...

Note that getting started with Emacs, Lisp, SBCL, Quicklisp and Git is possible in 3 clics thanks to Portacle (http://portacle.github.io/)

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

#43
For anyone who needs a "download and go" way to play with Lisp, Allegro offers a free version. It's one installation. For VS Code, I'd wire-up SBCL as others have said. It's a little touchy to get setup but we produced our product with it so it does work.

The whole issue of "flavors" largely comes down to one concept: Do you like the idea of functions and variables being in the same namespace (that's called a Lisp 1 like Scheme) or different (a Lisp 2 like CL). If you don't care, it doesn't matter which you pick.

If you're going to extend your Lisp app into production, you might want some of the many libraries that are available for CL. These cover just about every known topic and algorithm in comp sci and they're old and proven and just work everywhere, so that can be a benefit as you move to a non-trial app.

If you're going to distribute something written in Lisp (like an executable), then the flavor and implementation you pick will need to work all the way down your distribution path, and that can be challenging to get setup. One proven path is SBCL + Node.js + Electron to wrap your app for all three platforms.

Hope you love Lisp and get great things out of it!

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

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

Chiming in since I'm a bit disappointed with Clojure VS Code support:calva (the clojure extension) works great, unless you also want vim bindings. In which case it's a bit of a cluster. It's documented and I understand why - but it's still a pain point (it makes the escape key not exit insert mode anymore, by default).

(nota bene: I understand these things are hard to solve and I don't mean to throw the stone without putting my own time on the line to fix it, but that's one reason I'm not using VS code for clojure. Doom emacs with cider is still better, even if not perfect). If people know of someone I could throw money at to solve the integration for VS code, I'd be happy to do that.

If you find a good/great experience for clojure with vim keybindings, I'm all ears.

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

#45

Earlier quoted context omitted.

I'm aware of this. How do you achieve setters if the state you close over is immutable? Isn't that the default in Clojure, since it seems to aim for immutability by default?

You could have an atom that holds the state and a function which can update that atom. You might do something like the elm architecture where you pass a message to a reducer which produces the new state that the atom is set to. All the logic is contained in the reducer and is pure and immutable and the state change happens at a single controlled point.

OK. If I understood correctly, then you limit the mutable state to one point, and use functional logic everywhere around it. You can also optionally close over the atom to achieve encapsulation.

Thanks, TIL! That's equivalent to the "mostly functional" style that's doable in Common Lisp.

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

#46
When hackers[1] wax poetic about lisp, they focus on the core properties of the language (-family) that aren’t found in other languages. The meta-circular evaluator (lisp interpreter/compiler in lisp), “homoiconic” syntax (enabling easy modification of code), and others. These are what stuck with me most strongly.

ClojureScript (cljs) (and Clojure) I would recommend as practical, but simple and approachable dialects.

Scheme is a good, simple dialect to learn if you’re just looking to grok lisp in “maxwell’s equations” elegance (but not work in it). Not nearly as many libraries written for it as Common Lisp has, or Clojure with JVM interop, or CLJS with javascript+node interop).

Whether you use Scheme or cljs (or another~), I recommend SICP[2] “Structure and Interpretation of Computer Programs”, free online from MIT press. There’s even an interactive, editable version online [3] (though it doesn’t support saving reader code)

[1]: http://www.paulgraham.com/lisp.html

[2]: https://mitpress.mit.edu/sites/default/files/sicp/index.html

[3]: https://xuanji.appspot.com/isicp/

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

#47
Books

-ANSI Common Lisp by Paul Graham -On Lisp by Paul Graham -Simply Scheme -The Little Schemer -Structure And Interpretation Of Computer Programs -Paradigms of Artificial Intelligence Programming

Implementations

Common Lisp - any should be fine, I’ve used sbcl and clisp

Scheme - I like gambit scheme. It has a macro system that can be used like described in “On Lisp”

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

#48
post #43

For anyone who needs a "download and go" way to play with Lisp, Allegro offers a free version. It's one installation. For VS Code, I'd wire-up SBCL as others have said. It's a little touchy to get setup but we produced our product with it so it does work. The whole issue of "flavors" largely comes down to one concept: Do you like the idea of functions and variables being in the same namespace (that's called a Lisp 1…

OK, I want to know what's your product! (and if we can add your company to the "lisp companies" list https://github.com/azzamsa/awesome-lisp-companies ?)

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

#49

Earlier quoted context omitted.

I'm aware of this. How do you achieve setters if the state you close over is immutable? Isn't that the default in Clojure, since it seems to aim for immutability by default?

Through an atom ( https://clojuredocs.org/clojure.core/atom ). The idea of accesing a closure that is mutable is as follows: (let [temp (atom 0)] (defn getter [] @temp) (defn setter [val] (reset! temp val))) To implement an object, you would do something more like: (defn new-object [init-val] (let [temp (atom init-val)] {:getter (fn [] @temp) :setter (fn [val] (reset! temp val))})) (def obj (new-object 0)) ((:setter…

That's a good explanation. Thanks!

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

#50
post #43

For anyone who needs a "download and go" way to play with Lisp, Allegro offers a free version. It's one installation. For VS Code, I'd wire-up SBCL as others have said. It's a little touchy to get setup but we produced our product with it so it does work. The whole issue of "flavors" largely comes down to one concept: Do you like the idea of functions and variables being in the same namespace (that's called a Lisp 1…

OK, I want to know what's your product! (and if we can add your company to the "lisp companies" list https://github.com/azzamsa/awesome-lisp-companies ?)

Thanks for asking... and Yes!

[0]http://nebula.mimix.io

[1]http://home.mimix.io/en/dev/nebula

Post reply on HN