21 ms·
The Common Lisp Cookbook
- jlarocco 9y agoFor a more modern and up to date guide, Edi Weitz's "Common Lisp Recipes" is a great reference: https://www.amazon.com/Common-Lisp-Recipes-Problem-Solution-Approach-ebook/dp/B01JFTONBS/ref=mt_kindle?_encoding=UTF8&me= https://www.amazon.com/Common-Lisp-Recipes-Problem-Solution-... The more I use Common Lisp, the more disappointed I am that it hasn't become more popular. It really is higher level than Python, Ruby, or Perl but with nearly the performance of C and C++.
- lispm 9y agohttp://www.apress.com/us/book/9781484211779 http://www.apress.com/us/book/9781484211779 For those interested buying a copy of Common Lisp Recipes: I think Edi said that for the author it is financially better to go via his page: http://weitz.de/cl-recipes/ http://weitz.de/cl-recipes/ But then, supporting a local bookstore might also be an option. Though I have to confess, I got my printed copy from Edi as a gift... :-)
- nulldata 9y ago> The more I use Common Lisp, the more disappointed I am that it hasn't become more popular. It really is higher level than Python, Ruby, or Perl but with nearly the performance of C and C++. It's nice to hear that I'm the only one. I, not too long ago, picked up Common Lisp and after a bit of "getting it", it suddenly became one of my favourite languages. And by "getting it", I'm not talking about the difficulties people normally refer to when talking about learning lisps, it was learning how to develop with it. There's a huge productivity boost in just the fact that your development process is as follows: boot REPL, run your program and then modify your program (while running). If anything is to break, or hasn't been implemented, the debugger just stops your program, let's you inspect your program state freely and you can update the code that failed and have another go. I'm normally very much to the strong, static typing side of languages. But to me, the Common Lisp experience is dynamic done right, it gives all the tools to handle the problems that arise from a dynamically typed language (even though Common Lisp is actually partially strongly typed) with is a great boon to productivity.
- TeMPOraL 9y agoYou're definitely not the only one. I'm in the camp too. The language isn't perfect, but it's so much better than the popular dynamic ones that it's a shame it's still relatively obscure. And the development model of Common Lisp is what I strongly miss everywhere else.
- eatonphil 9y agoBy "development model" do you mean how the Common Lisp project is developed or how developers develop with Common Lisp?
- TeMPOraL 9y agoAren't those essentially the same? But if there's a difference, then I think mostly of the latter - of development experience when working on Common Lisp code.
- eatonphil 9y agoYes I suppose they are. :) I meant to ask if it was something about the way the project made decisions or picked direction. But it's clear now what you meant.
- graphene 9y agoHonest question, how is this different from what you can do in e.g. python? The python interpreter supports reloading of modules and evaluation of expressions, is there functionality that CL has above and beyond this that makes it more powerful?
- deleted 9y ago[deleted]
- TeMPOraL 9y agoCan you recompile a function on a running program and have it pick up the new definition? Can you change a class at runtime, and then adjust already existing objects to match the new definition in a controlled way, without data loss? Can you forget to define a function, or initialize a variable, only to be allowed by the debugger to provide a new definition / value on the fly and continue execution? Those are some examples off the top of my head, but the general point is that unlike mainstream languages, Lisp languages evolved into environment for interactive construction and modification on a continuously running program, which is a bit different way of working than the regular write-compile-run cycle.
- pjmlp 9y agoIf you want to be even more disappointed, have a look at Xerox PARC technical documentation about Interlisp-D, Smalltalk and Mesa/Cedar workstations.
- TeMPOraL 9y ago[*] But why can't we have nice things back?
- jmnicolas 9y agoBecause contrary to common belief, in capitalism it's not the best solution that wins, but the meanest shark.
- TeMPOraL 9y agoThat I know. But forgetting the hardware for a bit, at least software (in particular open source) is still (fortunately) a quite economically inefficient space. Yet there isn't much work going on in bringing the good solutions from the old days back.
- jmnicolas 9y agoI think it's not a matter of open source : there's no mean shark behind LISP but there's (a really mean) one behind C# (or Java or Swift etc).
- pjmlp 9y agoI like to think that JVM, .NET languages and their tooling, and to certain extent Swift (with Playgrounds), are ways to have those things back, even if not 100% the same.
- peatmoss 9y agoLike that discussion a while back about early competitors to CSS like DSSSL. Imagine if, instead of CSS/Javascript, we'd just had Scheme. In fact, imagine if instead of HTML/CSS/Javascript... we just had Scheme.
- nerdponx 9y agoAs someone currently learning CL, I think part of the reason it doesn't have widr adoption is that there is a huge number of features. Consider a language like Python. Aggressive duck typing means consistent syntax for different data structures and types. Stuff "just works" without a deep understanding of how it works. CL is the opposite. What is the difference between setp, setf, defvar, and defparameter? Why is the documentation so technical and dense? What is a "form"? What are multiple return values and how do I get to them? Should I spend time learning the loop macro DSL? I find it similar to Haskell in this regard. The base level of knowledge to use the language is so high that you pretty much need a book, or a degree, to be able to get started. That's a huge barrier to entry.
- TeMPOraL 9y ago> Stuff "just works" without a deep understanding of how it works. > The base level of knowledge to use the language is so high that you pretty much need a book (...) to be able to get started. I wonder what that says about developers these days. Ever since I started 'till this very day, it was obvious for me that if you want to learn something, you go pick a book about it. Books aren't scary. They have one of the highest knowledge-transfer-to-time ratios out of any sources you could find; they easily beat videotutorials and text tutorials. Most programming books I've read are also quite pleasant and easy to follow (better than some novels I've read...). Are people scared of books these days? I mean, I accept that the power of a tool can be a limiting factor to adoption, but I'm deeply saddened by it. Learning and understanding things isn't hard. -- > CL is the opposite. What is the difference between setp, setf, defvar, and defparameter? Why is the documentation so technical and dense? What is a "form"? What are multiple return values and how do I get to them? Should I spend time learning the loop macro DSL? The answer to that is simple: go and read a book :). Practical Common Lisp is available on-line for free, and it's a current best introductionary book for CL. http://www.gigamonkeys.com/book/ http://www.gigamonkeys.com/book/
- oblio 9y agoI think most people learned programming by doing stuff, not by reading books. Basic, Bash, Perl, PHP, Javascript all agree with me...
- pasbesoin 9y agoThat title is in O'Reilly's online Safari subscription library, for those who have an account. No affiliation -- just checked for myself.
- flavio81 9y agoKeep using Common Lisp and unite with us aliens on #lisp at freenode IRC!!
- laxentasken 9y agoStarted looking at getting into Racket and CL after reading up on lisp and there is something about it that really bugs me, in a good way. Sadly the train seems to have left the station regarding positions where you use lisp where I live. All is java and C-flavors.
- TeMPOraL 9y ago> All is java Possible tip: sneak in ABCL when they're not looking. ABCL is a Common Lisp implementation for JVM, with (what seems like) relatively OK interop between Lisp and Java code.
- toisanji 9y agoSeems dead
- kgwgk 9y ago> Seems dead The latest release (1.5) was earlier this month.
- cat199 9y agoplus: it's common lisp. if the language spec hasn't changed, and your code works, you don't really need to change the interpreter.
- iak8god 9y agoABCL's interoperability with Java is not part of the CL spec, but an add-on. This can make it easy to quickly get things done in a situation where Java libraries are the best tool for the task, but at the cost of portability between CL implementations.
- nikofeyn 9y agowhy would one do that instead of using clojure?
- fokinsean 9y agoI've never ventured into a lisp like language. Would you recommend starting with common lisp or is jumping into clojure ok? I have been in the JS, Java, Python world for a while and this looks like a language that could stretch my brain a little bit.
- justinhj 9y agoI learned scheme and emacs lisp before starting to use Common Lisp and then Clojure. There are differences between all of them but there's a big enough overlap you won't be wasting your time if you end up switching between them. Clojure is nice if you're already used to working with the JVM
- reikonomusha 9y agoIf you want your brain stretched, I recommend Common Lisp. The #1 issue for folks in my experience had been getting an environment set up. Emacs, SLIME, encodings, paredit, ... . It's a big barrier to entry.
- TeMPOraL 9y agoI agree (I know I had my issues with Emacs and SLIME when I started; being on Windows didn't particularly help). That said, for people who want to start with CL now, I'd recommend grabbing https://shinmera.github.io/portacle/ https://shinmera.github.io/portacle/. It's a portable Lisp IDE based off a pre-configured Emacs + SLIME + SBCL + Quicklisp + Git combo. I can confirm that it Just Works, out of the box.
- pnathan 9y agoOh hai Hacker News! vindarel on Github has been doing an enormous amount of contributions in the past two weeks, and the modern look and feel (and some of the more modern content bits) are entirely due to their hard work. eudoxia0 spent some time prior to that converting it and getting it modernized. I'd like to congratulate them on their work, since we're on the front page of HN. (I sort of steward the GH fork of the cookbook these days).
- znpy 9y agoHi, don't mean to interrupt anyone, just wanted to ask: why hasn't anyone made the common lisp hyperspec a prettier, more navigable and tooling friendly yet?
- daly 9y agoA Standard. One thing that has not been mentioned here. The lisp community came together and created a standard. I maintain code from the 1980, part of which is in Common Lisp and part of which is in C. The C code breaks. The latest failure seems to be caused by the GCC compiler changing the semantics of 'inline'. The include files differ between platforms. The Lisp code just runs. There are no arguments like Python 2.7 vs Python 3.x. No arguments about C++11 vs C++14. No arguments about Clojure from 4 years ago and Clojure today. No arguments about any of that. There is a standard. ONE standard. It only matters when you have to maintain someone else's legacy code. But it really matters.
- rurban 9y agoWell, amongst Lispers we do argument a lot about the missing or overarchitectured bits. The ffi, threads, the conditions system, the MOP, ... But only the various FFI's pose a minor problem. It's complaining on a very high level.
- daly 9y agoProbably the most difficult area in the CL standard is handling pathnames. There are so many possible pitfalls. FFI is an area that, despite best efforts, is likely not a good candidate for inclusion in a standard. It would be better to have all of the implementations converge on a convention since the underlying foreign systems will change over time. Not everything that "just works" has to be in a standard. C++ issues a "new standard" every 3 years or so which is just nonsense. Even Stroustrop said that the "new C++" is not the "old C++". They are adding ideas (e.g. Concepts) that virtually no one is asking for or knows how to use. Ten years from now that C++ maintenance job you have will be a nightmare. PL/I tried to be everything to everyone for every task and eventually disappeared. C++ is on the same long-term death march. You heard it here first.