7 ms·
ANSI Common Lisp (1995)
- tazjin 7y agoWell, if we're doing a generic Common Lisp thread some of you might be interested in buildLisp.nix[0], my project to write a build system for CL in Nix[1]. The idea here is that Nix should be usable for builds at the same abstraction level as Bazel (i.e. individual build targets), while retaining the power of the rest of the ecosystem. Example build "manifest" using buildLisp.nix: https://git.tazj.in/tree/third_party/lisp/alexandria/default.nix https://git.tazj.in/tree/third_party/lisp/alexandria/default... This has a few additional neat benefits, such as making it possible to easily spin up a REPL with the correct Lisp & dependencies loaded from within Emacs[2]. There's also a similar project I did for Go[3] to prove the general viability of the concept. [0]: https://git.tazj.in/tree/nix/buildLisp/ https://git.tazj.in/tree/nix/buildLisp/ [1]: https://nixos.org/nix/ https://nixos.org/nix/ [2]: https://git.tazj.in/tree/tools/emacs-pkgs/nix-util/nix-util.el#n69 https://git.tazj.in/tree/tools/emacs-pkgs/nix-util/nix-util.... [3]: https://git.tazj.in/tree/nix/buildGo/README.md https://git.tazj.in/tree/nix/buildGo/README.md
- zelly 7y agoNeat. I will try this. Check out Guix. It's similar but defines packages in Scheme, which I prefer greatly to the Nix DSL.
- tazjin 7y agoI actually prefer the Nix language[0] over Scheme, mostly because I enjoy not having to deal with namespaces (which also has drawbacks) and instead modifying one large expression. [0]: https://github.com/tazjin/nix-1p https://github.com/tazjin/nix-1p
- fmakunbound 7y agoLisp user here. Scratching my head on this one: What's it build exactly? Why would I use this over, say, Quicklisp? Is this just a Nix thing? Edit: Also, why do you need to specify all the .lisp files in the build(?) file?
- tazjin 7y ago> What's it build exactly? For libraries, it builds an output with a concatenated FASL for all inputs (which reference the sources by their exact hash in the Nix store, which means that they will be distributed alongside). For programs, it dumps an executable image (save-lisp-and-die with `:executable t`). For `buildLisp.sbclWith` it creates an SBCL that loads an image pre-loaded with all the dependencies. > Why would I use this over, say, Quicklisp? Quicklisp is one small bit of the puzzle (the distribution of packages using ASDF). Using Nix for the task replaces Quicklisp, ASDF, your distribution package manager used to install your Lisp, your distribution package manager used to install native dependencies of your Lisp code (e.g. cl+ssl with openssl[0]), your deployment tooling and generally your entire software packaging and distribution stack which leaves you with one homogeneous system that is easily composed across language boundaries. > why do you need to specify all the .lisp files in the build(?) file? I modeled this after the way Bazel rules are normally written, where specifying each source file is common. In fact, ASDF does this too. [0]: https://git.tazj.in/tree/third_party/lisp/cl-plus-ssl.nix#n22 https://git.tazj.in/tree/third_party/lisp/cl-plus-ssl.nix#n2...
- nabla9 7y agoANSI Common Lisp is good book to learn Common Lisp. I especially like the Appendix D: Language Reference. CL already has very good and comprehensive reference: the Hyperspec, but the Reference in the book is good companion to to it, very much like cheat sheet. You can quickly look up things. (my copy is already braking down from the end)
- lanternslight 7y agoThe hyperspec is awesome, but kinda rough to read at first glance.
- lispm 7y agoThere is also a Common Lisp Quick Reference for self-printing: http://clqr.boundp.org http://clqr.boundp.org
- triclops200 7y agoIf anyone is interested, this is a project you can use to generate a nice template for a compilable common lisp project for Linux that uses sbcl, which really reduces the initial setup pain for new projects: https://github.com/triclops200/quickapp/ https://github.com/triclops200/quickapp/ And this is a project that uses that to make quickapp itself a binary you can install: https://github.com/triclops200/quickapp-cli https://github.com/triclops200/quickapp-cli Both of these projects need a little TLC as I haven't touched them in a while, but they should still work.
- elteto 7y agoI want to give Common Lisp a try. My previous experience with Lisp (any variant) is almost nil. Would this be a good book to start with?
- lanternslight 7y agoTry Practical Common Lisp or Land of Lisp instead. They are both much more accessible. Then read ACL.
- dreamcompiler 7y agoAgreed. Read Graham's books after you're somewhat comfortable with the language, to learn advanced techniques. Norvig's books on Common Lisp are also a good place to start.
- jgalt212 7y agoSeconded, Practical Common Lisp was instrumental getting me to think in a sound modular fashion.
- Mugwort 7y agoGet a copy of Racket, take notes, type in the programs for yourself, experiment. This video is the best most direct introduction I have yet found. https://www.youtube.com/watch?v=a5p8DPbaokE https://www.youtube.com/watch?v=a5p8DPbaokE Learning Lisp, Scheme or Clojure is more about learning ideas than anything else. Later you might want to learn Alonzo Church's Lambda calculus after learning some set theory and mathematical logic.
- dreamcompiler 7y agoRacket is not Common Lisp. It's not a bad idea to learn it, but the questioner specifically asked about Common Lisp.
- zelly 7y agoPractical Common Lisp (first few chapters) do a toy project read a lot of old Common Lisp code floating around on tarballs then read Paul Graham's books
- mr_luc 7y agoI feel like the Common Lisp and Erlang communities have produced writing about software that has really stood the test of time. From the CL spec, to Norvig's "Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp," to both of pg's CL books (this one and 'On Lisp') -- these all feel readable, even re-readable, and entertaining. And of course the same can be said of the Erlang books -- I'll read anything I find by Joe Armstrong or Robert Virding. In both cases, authors are able to joyously present the language's unique superpowers and ways of thinking (CL-style macros, OTP). But I think a crucial factor is that, since both languages are very practical -- in terms of their reason-to-exist, as well as what they provide 'out of the box' -- the writing tends to be imbued with the energy and possibility of actually building things.
- agumonkey 7y agoBoth came of academic roots (mit/ai, and prolog influences for erlang), to me it gave a very dry but highly structured conceptual foundations. I mean lisp is mostly tree recursion everywhere. Unlike simpler languages that were use-case driven, and iterated over the absorption of better concepts over time, waving between fads.
- dreamcompiler 7y ago> I mean lisp is mostly tree recursion everywhere. Two things: 1. This isn't true. Common Lisp style emphasizes looping; Scheme emphasizes recursion. 2. What's wrong with tree recursion anyway?
- zerr 7y agoMany think/prefer that it is a compiler's job to convert conveniently (Algol-style) written program into AST, even if this reduces the macros capabilities - even Norvig switched to Python long time ago :)
- dreamcompiler 7y agoSome of us find that writing ASTs directly with a smart editor is much more convenient than writing Algol-style languages. Norvig switched to Python when he left NASA and went to work for Google. He wasn't going to convert Google's culture to one that embraced Lisp.
- scottmsul 7y agoI read through much of this book as a fun hobby/side project. I felt at times this was a book written by a genius for geniuses... For example, there's a chapter on numerics. Simple, right? PG's "example" was a full ray-tracing library in only about three pages. There were single pages that took me an hour to read and understand fully. Very cool/fun stuff, but also extremely terse, especially if you're new to lisp.
- mxyzpt1k 7y agoI have a copy for home, one for work, and one to lend. "On Lisp" by the same author is a wonderful glimpse into the power of macros.
- kristianp 7y agoYou use it at work?!
- 3fe9a03ccd14ca5 7y agoWhy is lisp still so uncommon today as a practical, business-needs language? Everyone I know who uses it loves it, but it’s virtually nonexistent in today’s enterprise.
- dreamcompiler 7y agoBecause it's not popular, and managers like popular languages because they imply a large supply of fungible programmers. Whether the language is actually powerful (or even useful) is never as important as popularity.
- cmrdporcupine 7y agoIt's more that a language and its relative expressive power is not nearly as important to project success as the ecosystem around it. Who can I hire? If I lose them who can I replace them with? What frameworks can we use? How can I get support?
- philodelta 7y agothis is tangential to your point, but I feel as though I personally use this justification often in technical projects, a wide base of users often means a large base of accessible supporting material and community. while I'm sure of the utilitarian justification I can't help but feel it's also laziness on my part.
- randallsquared 7y agoBecause it rewards depth-first expertise rather than breadth-first, and there are few deep experts and many broad experts.
- zelly 7y agoIn theory there's no reason it shouldn't be used. CL has OOP, GC, very mature optimizing compilers. It was used in industry a lot as the faster-to-develop alternative to C, but then Java/Python pretty much took over since the dotcom era. In Java/Python (and now Go), there's generally only one way to do any given thing. A business can hire people who were trained the same way to stamp out idiomatic code. Lisp hackers create works of art that no one else can figure out after they leave. If you're working on something on your own, or with a small group of people, then you don't have to dumb yourself down. You can always rewrite it later in Java/Python/Go if the project gets big enough that replaceable cogs need to be hired.
- the-alchemist 7y agoI wonder what Paul Graham thinks of Clojure, which is the only Lisp I really have experience with. I love being able to take advantage of all the wonderful Java libraries out there. Nowadays, I think you can even use Python libraries from Clojure [0]. [0]: https://github.com/cnuernber/libpython-clj https://github.com/cnuernber/libpython-clj