Live data from Hacker News

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

news.ycombinator.com

91–100 of 211 posts

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

#91

There are obviously many possible paths, so I can only really tell you what I've done. I can't say it's necessarily the best approach. For me, I decided to start with Common Lisp. I installed SBCL, Slime for Emacs, and started working through the book Practical Common Lisp . By and large this seems to be a workable approach, but I will offer up this caveat. The PCL book is very much "project based" in that the author…

Seconded. PCL ist in my eyes one of the best and most "modern" Common Lisp books around. SBCL is probably the best Common LIsp compiler and free on top of that. Paired with Slime and Emacs you have a professional development environment. I use it regularly.

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

#92

Earlier quoted context omitted.

What would be an example of "problems that are shaped in an object-oriented way"? That just doesn't sound like a thing to me. That may originate from a bias you may have from developing primarily in OO languages. Clojure does have constructs to manage state. You don't need to shove it all into your function arguments.

Sorry for the mind shortcut. By that, I meant all sorts of problems where multiple state-bearing entities communicate via message passing - usually implemented via method calls in OO languages.

Well Clojure most definitely does support state-bearing entities that communicate using message passing (channels / agents / atoms...) and, while I confess I that I personally don't use them in _quite_ the same way that I use objects and method calls in an OO language, I find that programming in OO and functional languages is kind of converging towards the same point: functional programming in the small (immutable value objects that are worked on using pure functions) and OO in the large (state-bearing entities communicating using message passing).

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

#93

I forgot to ask in my main question. I can't edit it anymore. I am seriously thinking of learnijg common lisp. Thank you for all the suggestions. Is it possible to build web apps in common lisp or any lisp? Any frameworks available? Is it possible to build multithreaded apps that use multiple CPU cores for performance? What is used? POSIX threads?

Sure thing, look: https://github.com/CodyReichert/awesome-cl#web-frameworks and https://github.com/CodyReichert/awesome-cl#parallelism-and-c...

The Cookbook on web development: https://lispcookbook.github.io/cl-cookbook/web.html

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

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

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

Here is my attempt to make it easier to get started with vanilla Emacs + SLIME + SBCL without hiding the underlying details like a starter pack does: https://news.ycombinator.com/item?id=25440690

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

#96

Earlier quoted context omitted.

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.

There's also the added benefit of Software Transactional Memory being available for operations on said mutable state, in case you need to access it from multiple threads.

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

#97
post #50

Earlier quoted context omitted.

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

Thanks! I shared on reddit for now: https://www.reddit.com/r/Common_Lisp/comments/keb6iu/another...

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

#98

I forgot to ask in my main question. I can't edit it anymore. I am seriously thinking of learnijg common lisp. Thank you for all the suggestions. Is it possible to build web apps in common lisp or any lisp? Any frameworks available? Is it possible to build multithreaded apps that use multiple CPU cores for performance? What is used? POSIX threads?

The "web apps" problem is the most important one, I think. The short answer for us was the strangeness of building HTML or GUI UI's with Lisp. The solution we used was to make our UI in HTML/JS/Angular and have it talk to a Lisp backend with Node.js.

In this way, we use Lisp for what it's good at and use HTML/JS to make a modern front end.

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

#99

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…

Re language choice, you should be aware that CL is a massive language and requires you to know a lot of things about it to be efficient. With Scheme (Racket), you'll be able to ramp up easily as it requires less knowledge (as long as you are not doing metaprogramming). You also have the option of using Scheme itself to have something even simpler (Chez, gerbil, lots of choices here).

So you should ask yourself what your use for Lisp is. If it's just for fun, I'd go with the simplest.

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

#100
post #33

Earlier quoted context omitted.

https://wiki.c2.com/?ClosuresAndObjectsAreEquivalent

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?

Apologies in advance for going on a slight tangent here but it's my view that defining getters and setters is not considered idiomatic OO code either. If one object is using getters and setter to access the state of another then this suggests that there feature envy and excessive coupling between those two objects. These days, I try to follow the Law Of Demeter (https://en.wikipedia.org/wiki/Law_of_Demeter) and avoid that sort of thing. The logic that calls the getters and settings should really be in a class with a single responsibility that we call by invoking its methods in a tell-don't-ask style. As others have already pointed out, we can do similar things in a functional language like Clojure by encapsulating state in an atom (or an agent) and applying pure functions to that state.
Post reply on HN