15 ms·
Learn Lisp the Hard Way
- readonthegoapp 4y agodomain seems to have gone away https://llthw.common-lisp.dev/ https://llthw.common-lisp.dev/
- mark_l_watson 4y agoFrom just reading the TOC, and the first bit, this looks great. Like the author, I have been into Common Lisp “forever.” I do sometimes feel conflicted when I can get something done in Python much faster because I can find a library that solves the problem I am working on. Probably my most honest advice to people is that Common Lisp is very good for research programming, but for many use cases other programming languages are better.
- wglb 4y agoI would disagree. See the note at https://news.ycombinator.com/item?id=34333276 https://news.ycombinator.com/item?id=34333276
- seanw444 4y agoYeah I haven't found any project I've wanted to implement in CL. I usually end up using Python or Go at that level of abstraction. If I want lower-level, C or Rust. However, I interact with Lisp almost daily through Emacs. And I enjoy it quite a bit. Configuring my editor through Lisp is unusually satisfying, and feels sleek.
- tombert 4y agoThis is why I’ve found myself doing Clojure for everything. Clojure has its own pretty-ok ecosystem, but also benefits from the Java ecosystem, while still giving me some lispey goodness. Granted, sometimes the mixing of paradigms can kind of clash, and that’s its own can of worms, but at least I never get that “ugh I could have done this with a library in <language X>”
- mmcdermott 4y agoWhen I reference Java from Clojure, I usually wind up with a thin layer of wrappers around the part of the library I need to make the main codebase feel more properly Lispy. It isn't perfect with the different mental models between the languages, but it helps.
- tombert 4y agoYeah, and I think wrapper functions are fine and normal. The part that I do find annoying is when I have to break out macros to make my wrapper usable. When I was using the Java bindings for Apache Spark a few years ago, I felt like I was constantly reaching for macros to do some clever stuff, which is no fun.
- martinflack 4y ago> I can get something done in Python much faster Take a look at the CL libraries PY4CL, PY4CL2, and CL4PY. I use the first one for some things. It can be useful to bridge over to Python for something and come back with the answer.
- mark_l_watson 4y agoThanks, I have been using py4cl for a year or two. I have an example in my Common Lisp book that you can read online: https://markwatson-com-website.pages.dev/books/lovinglisp-site/ https://markwatson-com-website.pages.dev/books/lovinglisp-si...
- yourapostasy 4y ago> ...because I can find a library that solves the problem I am working on. I couldn't find it, but is there a "Rosetta Stone" of language ecosystems, where in a "libraries" section it lists Python/Go/Rust/Ruby/Perl/Lisp/etc. library near-equivalents?
- tmtvl 4y agoI don't recall ever coming across one of those, it may be a neat idea to set that up.
- deleted 4y ago[deleted]
- JLCarveth 4y agoA question I have that's not answered by the link is why would I want to learn lisp? If you were starting a project today, what are some of the features Lisp offers that make it a better choice than any other (more popular) language? And do those features outweigh the lack of community the larger languages have?
- deleted 4y ago[deleted]
- rjsw 4y agoI use Common Lisp because applications run faster than those written in Python or Ruby and are easier for me to write than if I was using C++.
- ravi-delia 4y agoHonestly I just really like the ergonomics of CL. A lot of the features totally exist elsewhere, but weirdly you don't see things like implicit return or a total focus on expressions in dynamic languages too often. Also, I'm a weirdo that genuinely finds parentheses pretty. It's the language I use for all my personal projects because it's the language I enjoy using the most. I don't think I'd use it for work though- the benefits are pretty individual, and people in general seem to like C over CL.
- weaksauce 4y ago> but weirdly you don't see things like implicit return that's been a thing in ruby since probably forever and it's one of the defining things about it
- ravi-delia 4y agoAnd Elixir, from both parents. Ruby is an odd duck in a lot of ways, being so lisp- and smalltalk-inspired. It also only has expressions- another functionalish feature that seems like a total no-brainer. Beyond Ruby though, we just aren't looking at a huge number of dynamic languages with these features.
- revskill 4y agoThe problem with almost all LISP tutorials, books,... is there's no guide on how to install toolings at the beginning. Instead, there's just praise and praise. Such a missed opportunity.
- rjsw 4y agoThere is a section of the Preface on "Configuring Your Development Environment", seems pretty complete to me.
- revskill 4y agoPreface section as i see is applied for whom who already get used to LISP. If audience is whom who doesn't know anything about LISP, you've lost time to go around to find things you want. Other languages have playground, or at least INSTALLING at the chapter 1. It should answer some IMPORTANT questions: - How to install the compiler - Which IDE best to use, or which extension. - How to install packages, how to build it.
- lilith_of_debts 4y agohttps://llthw.common-lisp.dev/configuration.html https://llthw.common-lisp.dev/configuration.html Literally everything you're asking for is in that link. The author has the opinion that you don't need fancy IDE features which is an arguable point but they do list what editors for each OS work in their experience.
- noNothing 4y agoI first leaned lisp in college (1964) and have not touched it much since then. But now that I am retired I am going to give it a shot. What extensions in vscode should I use? I installed steel bank and quicklisp. Thanks,
- Mikeb85 4y agoNowadays it's pretty much as simple as installing SBCL and then Emacs-Slime.
- submeta 4y ago[flagged]
- deleted 4y ago[deleted]
- dang 4y agoPlease don't start programming language flamewars. We (and Lisp!) had enough of those a long time ago, and part of the idea of HN is to avoid this kind of thing. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- stassats 4y agoWhat drives people to attempt to persuade others that Lisp is not practical?
- dang 4y agoRelated: Learn Lisp the Hard Way - https://news.ycombinator.com/item?id=8573389 https://news.ycombinator.com/item?id=8573389 - Nov 2014 (32 comments) Learn Lisp the Hard Way - https://news.ycombinator.com/item?id=8016950 https://news.ycombinator.com/item?id=8016950 - July 2014 (141 comments)
- dockleaves 4y agoThat is interesting. I am wondering though, in what areas does Lisp get used these days? What would be a good project to showcase the strengths of Lisp, versus other well-known languages? How/why do people end up learning Lisp, what is the usual route to entry? Genuine questions, not trying to start a language battle here. I've never used Lisp before so am curious about all of this. To me it feels like one of those exotic old-school languages like Erlang or Perl.
- kaliszad 4y agoI guess basically for anything. From AutoCAD (https://en.wikipedia.org/wiki/AutoLISP https://en.wikipedia.org/wiki/AutoLISP) extensions to grammar checking engines (https://www.grammarly.com/blog/engineering/running-lisp-in-production/ https://www.grammarly.com/blog/engineering/running-lisp-in-p...)? If you count Clojure and ClojureScript as kind of Lisp then for instance our whole product (https://orgpad.com https://orgpad.com) backend and frontend is written in it. Of course there is also some SQL, CSS etc. in between but basically all the meat is in CLJ or CLJS.
- TacticalCoder 4y ago> I am wondering though, in what areas does Lisp get used these days? If you consider Clojure a Lisp then I think before the tech stocks crashed there were seven unicorns built with Clojure. Banking, healthcare, analytics, ... I'd say Clojure can be used anywhere Java can for sure. And Clojure runs on top of ClojureScript too. Then Clojure is only one of the Lisp dialects and there are "lispier lisps" out there which also their success stories.
- jimbokun 4y agoInteresting 5 of those unicorns are listed here: https://clojure.org/news/2021/08/13/deref https://clojure.org/news/2021/08/13/deref
- wwfn 4y agoI'm also very curious for hear from expert lispers. I've tried to find the sweat spot where lisp would fit better than what I already know: shell for glue and file ops, R for data munging and vis, python to not reinvent things, perl/core-utils for one liners. But before I can find the niche, I get turned off by the amount of ceremony -- or maybe just how different the state and edit/evaluate loop is. I'm holding onto some things that make common lisp look exciting and useful (static typing[0], APL DSL[1], speed [2,3,4]) and really want to get familiar with structural editing [5] [0] https://github.com/phantomics/april https://github.com/phantomics/april [1] https://github.com/coalton-lang/coalton/ https://github.com/coalton-lang/coalton/ [2] https://renato.athaydes.com/posts/revisiting-prechelt-paper-comparing-languages.html https://renato.athaydes.com/posts/revisiting-prechelt-paper-... [3] https://github.com/fukamachi/woo/blob/master/benchmark.md https://github.com/fukamachi/woo/blob/master/benchmark.md [4] https://tapoueh.org/blog/2014/05/why-is-pgloader-so-much-faster/ https://tapoueh.org/blog/2014/05/why-is-pgloader-so-much-fas... [5] https://github.com/drym-org/symex.el https://github.com/drym-org/symex.el
- tromp 4y ago> The biggest secret to Lisp is that it is actually the simplest programming language ever created---and that, coupled with its expressiveness and elegance, is why it is favored exclusively by the best programmers in the world. This is clearly a very opinionated book. Personally I find Haskell, while perhaps not as simple, both more expressive and more elegant. But I don't imagine it is favored by the worlds best programmers.
- deleted 4y ago[deleted]
- robomartin 4y agoI used LISP and APL professionally for, in the aggregate, over ten years. My current opinion on these languages is that software engineers would benefit greatly from learning and understanding them, yet it would be a mistake to use them for any modern work. When I say "learning" I mean in-depth application over, perhaps, a year, not something superficial. The question is how. I don't really have an answer for that. You have to find reasonably complex projects to be able to spend that much time with a language. That's the problem. I was getting paid to use these languages back then. Who wants to do non-trivial work in these languages today. Not many.
- srejk 4y agoI read the little LISPer (now the little SCHEMEr) years ago, I found that was a great way to teach recursion.
- baby 4y agoMy uni used scheme to teach us about recursion. Honestly I don't get it, why not just use Python? That would have been much more useful and applicable IMO.
- Jtsummers 4y agoPython doesn't offer tail call optimization, which makes it a poor fit for a lot of the instruction you'd want to provide on recursion. Especially paired with its default recursion limit (1000?) which means you can't run to any interesting depths anyways, tail recursion or not. Besides, if you're studying CS at a halfway decent school you'll learn a half dozen languages before graduating anyways (if not more), what's one more to you?
- baby 4y agoI was actually not doing a CS major so I would have prefered learning Python. Ended up learning it on my own, so much more useful as a language. Also, we did not even learn tail call optimization :) so while the argument is valid (I guess it's easier to learn scheme than erlang, ocaml, etc.) it wasn't in my case.
- Jtsummers 4y agoIf they were teaching you recursion with Scheme and didn't teach you about tail calls and tail recursion, then you got cheated. That's usually the second thing you learn about recursion in Scheme after learning how to make recursive calls. It's essential to actually making efficient recursive routines in Scheme.
- int_19h 4y agoTeaching recursion doesn't mean teaching to do everything with recursion, though. Normally with a language like Python (or, back in my school days, Pascal), you learn stuff like loops first. Recursion is demonstrated on use cases that are not easily done by a loop - e.g. drawing a snowflake.
- kaveh808 4y agoRegarding the question of "Why [Common] Lisp?"... I did early Lisp development on Symbolics Lisp Machines back in the day. Wrote 3D graphics on them. I didn't realize how special the development environment was until I got my first job, writing 3D graphics in Fortran on VAX/VMS. Spent the rest of my career (Fortran, C, C++, IRIX, Linux) bemoaning all the stuff I missed from my Lisp days. I did venture back into Common Lisp development (MCL/CCL on MacOS) for my personal projects. Even did my masters thesis in CL by writing a socket connection to Maya and using it as a graphics engine from CCL. It took me a long time (decades) to get over the "everyone should be using CL" mentality. Thinking back on things, I have come to realize that Lisp is not a magic bullet: it won't necessarily make you a better programmer, and it won't necessarily make your project more successful. What Lisp will do is give your developers more power at their fingertips. For better or worse. The philosophy behind Lisp (and Smalltalk) back in the 70's and 80's was that programmers should be given as much expressive power as possible so they can develop better, faster, etc. The reason why CL allows you to define macros, redefine classes and methods on the fly, use generic functions and multiple inheritance, and recover from errors, is simply that the language designers considered these import enough to do the hard work to make them happen. I feel that philosophy, backed by the economics of software development, fell out of favor over time. Performance, safety (preventing developers from shooting themselves in the foot), code maintenance by large teams, cost, etc became more important. Today, the main factors in language choice are (1) the availability of developers, and (2) the availability of libraries/tooling. Going against these currents requires awareness and a strong commitment. To paraphrase an old computer industry saying: no one got fired for choosing Java. On a personal note, I continue to use CL for my own projects, where the pleasure of development is more important to me than commercial considerations. I have done so for kons-9, my 3D graphics system, and am happy that I did so. I simply would not have been interested in doing the project in C++. I find that CL is a language which supports me in my development, rather than fighting back. As an added bonus, the features of CL have encouraged me to think differently about the architecture and design of the system. A system built in C++ would simply have converged towards being another Maya/Houdini/Blender (at best, after many years of development). This way, I have a chance to do something different, which is a big part of the fun.
- bogomipz 4y ago
- DonHopkins 4y agoI was afraid this would be a link to a site selling vintage 110 BAUD Teletype Model 33 ASR teleprinters.
- simonblack 4y agoC'mon now. What is wrong with ASR 33s? That was my first I/O device at home. (Heavy, slow and noisy!) But the paper-tape sub-system was fun to use.
- pvg 4y agoTeleprinters? Luxury! There were a hundred and sixty of us learning LISP in a single cons cell in the middle of the road.
- rcgorton 4y ago[dead]
- 10g1k 4y agoLearning LISP the hard way: One of my teachers: "Oh, you've never done any programming? Cool. Your first assignment is creating a game of 圍棋 in LISP. Go." Awesome, thanks.
- cbrozefsky 4y agoBefore there were tens of thousands of open source developers across a dozen or so language ecosystems using collaborative source control and the hard won, but sometimes forgotten, wisdom of decades of internet systems development; we had to build so much more of our stack ourselves. It was much less about finding the appropriate "libraries" or "frameworks" -- their were not that many to even choose from. You would have to build the layers of your stack from first-principals, or perhaps second-hand mimicry of third hand descriptions. Understanding your problem, and building exactly the tool needed is a very different approach from picking the tool with the momentum, growing developer base, checklist of features, and knobs to twiddle to somehow get something approaching a solution to your problem. In that setting, Common Lisp has a very powerful feature set; macros, CLOS, interactive debugging with restarts, dynamic redefinition and a fast runtime made to be interactively modified. It is a few days work to make a minimalist ORM, a HTML template language, or a functional query language and engine and proceed to tune it for purpose. I think we are approaching an inflection point. The software ecosystem complexity, and the specialization of developers into frontend, backend, or specific frameworks and the absolutely unfathomable and delicate chains of transitive trust in the layers and layers of abstraction will become a liability . Doing "more" of the same, throwing more bodies at it, rewriting the world because your UI or ORM needs a reboot, trying to attach checksums and technical proxies for dependencies as a substitute for the basic fact that you need to know what code you are running and why to be a responsible software vendor; none of this will work. Truly powerful languages and runtimes with appropriate technology fit for purpose are the way out of this conundrum and the best path to being a responsible and effective computer programmer. Keep your parens sharp.
- deleted 4y ago[deleted]
- quanticle 4y agoDoing "more" of the same, throwing more bodies at it, rewriting the world because your UI or ORM needs a reboot, trying to attach checksums and technical proxies for dependencies as a substitute for the basic fact that you need to know what code you are running and why to be a responsible software vendor; none of this will work. You're assuming that the "bodies" being thrown are going to continue to be human. But what if they aren't? We've already seen what can be done with the very early, relatively primitive AI programming assitants that we have today. What happens when we're competing against an army of Java/Python/Go programmers, all of whom have extensive AI assistance? I love Lisp. All Lisps. Common Lisp. Scheme. Clojure. Even elisp. And, for a long time I thought Lisp was the future. I thought, like you, that the ever expanding size of codebases written in more conventional programming languages would necessitate a switch to something more functional and more amenable to building non-leaky layers of abstraction because that would be the only way to continue to build without introducing at least one bug for every new feature. However, the advent of LLM powered coding assistants (like OpenAI's Codex, or Github's Copilot) has made me reassess my view. LLMs benefit from having more training data. Now, the thing that I thought would kill Java/Python/Go codebases, i.e. the sheer number of lines of code required to do even the simplest thing, turns out to be a strength. Because each line (and all its variants) now represents a datum point in the training set for the AI. Can Lisp be enhanced with AI support. Sure it can, in theory. But in practice, there's far less Lisp code out there. Primarily this is because far fewer people use Lisp on a regular basis. But it's also because, for any given task, far less code is required to accomplish it. Just like Java's greatest weakness turned out to be a strength in a world where we have AI assistance, Lisp's greatest strength turns out to be a weakness. I'm going to continue to use Lisp wherever I can. If not at work, then in my projects at home. But I'm far less sanguine today about the eventual dominance of Lisp (and Lisp-like languages) than I have been at any time in the past.
- Hugsun 4y agoI heard somewhere that lisp programmers tend to start overly ambitious projects and never finish them. This applied to me when I was most interested in lisp. This books reads to me like this observation turned into a practical joke. The draft of this book suggests years of work to populate all the exercises and it has unfortunately hardly been edited since 2015. I just looked at the author's github page and it fits this stereotype almost too well. I am like this too and I would really like to know why this is and why people like us flock to lisps.
- deleted 4y ago[deleted]
- peter303 4y agoLISP was the introductory computer class language at MIT for nearly 40 years. The faculty felt it exhibited the important elements of programming and algorithms. Some students complained they wanted something more practical for getting a job. It appears the newer faculty replaced it with Python.
- alwayslikethis 4y agoThe MIT SICP course is pretty amazing. Would be a shame if they replaced it with Python. I use Python every day, but it's far more complicated to use it to demonstrate various properties of programming languages due to its great complexity.
- melagonster 4y agodon't worry, they have JavaScript version now. maybe it more complex, but at least can execute immediately.
- wrycoder 4y agoThe MIT Scheme interpreter executes immediately, like Python. Maybe people these days can't handle anything beyond a browser?
- melagonster 4y agowow, do you understand it can't run on windows? so guess you require student who bought windows computer give up programming? last time, I installed Racket and get sicp module. guess people really need move to JavaScript. at least, they don't need to spend time on this.
- kagevf 4y agoMy understanding is that the authors of SICP themselves wanted to update the curriculum - not just a language change, but to cover something at a higher level of abstraction. See: https://youtu.be/OgRFOjVzvm0 https://youtu.be/OgRFOjVzvm0
- mrcheesebreeze 4y agoWhy would I learn that, I like speaking normally. ¯\_(ツ)_/¯
- pingiun 4y agoDid this domain expire? I can't seem to do a DNS lookup
- omgmajk 4y agoHave been trying to get to this link a couple of times during the day, did we kill it?
- gdelfino01 4y agoLooks like it is down. While they recover, you can use this: https://web.archive.org/web/20230111080211/https://llthw.common-lisp.dev/ https://web.archive.org/web/20230111080211/https://llthw.com...
- omgmajk 4y agoThank you!