11 ms·
A Road to Lisp: Which Lisp
- avph 2mo agoI recently started looking at https://github.com/elle-lisp/elle https://github.com/elle-lisp/elle . It's made with AI but has an interesting feature set.
- disruptek 2mo ago[dead]
- hnarayanan 2mo agoSo many words to say: Scheme. :)
- nobleach 2mo agoPerhaps, but Chicken? Guile? Chez? They're all pretty cool.
- tmtvl 2mo agoR5RS, R6RS, or R7RS?
- nathan_compton 2mo agoR6RS.
- criddell 2mo agoAnother Lisp of note is AutoLISP. Elisp::Emacs as AutoLISP::AutoCAD. AutoLISP was my first introduction to Lisp-style language. When I first started using it (1987) for macros in AutoCAD, I really had no idea what Lisp was. It was just a fun and easy way to automate AutoCAD.
- hnarayanan 2mo agoI had forgotten about this. The last I saw this was 20+ years ago!
- timonoko 2mo agoAdding and substracting 3D-objects was the same as in OpensCAD. Strange they did not make OpenSCAD in AutoLISP-style. I have to read the manual all the time, because I never learn the weird syntax of OpenSCAD for-statement.
- 0xb0565e486 2mo agoI really wanted to Lisp as a main programming language, and sometimes I still do. I just find readability such a hurdle regardless of how long I used it. I didn't find that it ever became as natural as the other group of programming languages. I find a procedural style of programming so much easier to reason about, both when writing and reading. Either way, I'm really happy I took some time to learn it and use it a little at some point.
- dieggsy 2mo agoFor me, the most effective way to read Lisp is to essentially forget the parentheses (I shadow them out in matching, low contrast colors) and go almost entirely by indentation. I find this makes it more similar to reading other languages, though granted not exactly the same. You do have to keep up with the parentheses of course, but editor settings or extensions can make this automatic if not invisible.
- groundzeros2015 2mo ago(Heresy alert. Inb4 homoinconcity) I do find that most of my lisp skills carry over to JavaScript quite well while allowing me to write imperative functions more fluently. Prog blocks are pretty good. I wonder if another DSL could be better.
- hnarayanan 2mo agoMaybe because Brendan Eich was tasked with "doing Scheme in the browser" before it pivoted to JavaScript.
- dieggsy 2mo agoCL also has pretty much arbitrarily extensible syntax: - https://sr.ht/~dieggsy/whisper/ https://sr.ht/~dieggsy/whisper/ - https://dieggsy.com/json-literals.html https://dieggsy.com/json-literals.html And could also be used to build languages, supporting more modern programming paradigms (though yes, I believe Racket does make this easier): - https://coalton-lang.github.io/ https://coalton-lang.github.io/ I also might have written the Common Lisp example using reduce as well, which is in the standard library, but that's preference. Nice to have the option though: (defun calculate (instructions) (reduce (lambda (result op-value) (destructuring-bind (operation value) op-value (case operation (:add (+ result value)) (:subtract (- result value)) (:multiply (* result value))))) instructions :initial-value 0)) (calculate '((:add 5) (:multiply 3) (:subtract 4))) ;; => 11
- BoingBoomTschak 2mo agoI'd have used (funcall (ecase operation (:add '+) (:subtract '-) (:multiply '*)) result value) instead, looks funkier =)
- dieggsy 2mo agoOh yeah, way more fun :) I just kinda saw CL in the Clojure and was trying to make it look like that.
- kazinator 2mo agoDid you know CL allows keywords to be function names? [1]> (setf (symbol-function :add) (function +)) #<SYSTEM-FUNCTION +> [2]> (setf (symbol-function :subtract) (function -)) #<SYSTEM-FUNCTION -> [3]> (setf (symbol-function :multiply) (function *)) #<SYSTEM-FUNCTION *> [4]> (setf (symbol-function :divide) (function /)) #<SYSTEM-FUNCTION /> [5]> (reduce (lambda (x y) (funcall (car y) x (cadr y))) '((:add 5) (:multiply 3) (:subtract 4)) :initial-value 0) 11 This is actually a small benefit of the two namespaces. Keywords can't be variables because they evaluate to themselves, but that is not relevant to the operator position that does not resolve variables.
- BoingBoomTschak 2mo ago(Disclaimer: CL weenie) A decent and balanced writeup IMO. But it should really have contained the following: Warning about the issues that come with ANSI CL's frozen spec (threads/sockets/unicode/extensible sequences/gray streams/etc... as extensions with a varying amount of support with compatibility layers often available to write portable-ish code, "bolted-on" CLOS never fully integrated) and its various rust spots, not just the good points. Mention that CL has provisions for gradual typing (with limits) which are exploited by SBCL. Scheme, obviously, along with the same warning as CL about pain of writing portable code that interacts with the OS (does it have compatibility layers like CL?) amplified by the R6RS vs unfinished R7RS-large mess. A few words about the build system/third-party packaging situation and alternative implementations.
- groundzeros2015 2mo agoFor me the complete spec is the killer feature. You can learn Common Lisp in 1990 and write it the same now. As long as we can keep the compilers alive it will be forever. It’s funny to me that it was critiqued for being “bloated” when now it looks like a focused minimal library.
- dismalaf 2mo agoCommon Lisp wasn't standardised until 1994. Also, SBCL has some nice features specific to them, I'm sure it's the same for other implementations. So while there's a lot that's common between them all I find myself using a lot of platform specific functions.
- Jtsummers 2mo agoYes, but it existed before then (from 1984 on), and a large amount of code written for CL pre-standardization still runs without alteration or with minimal updates.
- pfdietz 2mo agoIt's small enough a single person could write a test suite for the whole standard.
- ChrisArchitect 2mo agoRelated: A road to Lisp: Why Lisp https://news.ycombinator.com/item?id=48845209 https://news.ycombinator.com/item?id=48845209
- wollowollo 2mo agoI wonder if Hylang is still alive.
- bbkane 2mo agoThere's also Rhombus now: https://docs.racket-lang.org/rhombus-quick/index.html https://docs.racket-lang.org/rhombus-quick/index.html
- ynniv 2mo agoI have a work-in-progress called Modus. 100% written by Claude, so take that however you will. The current release boots on a Raspberry Pi Zero 2 W. The next release (unreleased in the pipe for ~ months) is standard Common Lisp on bare aarch64 (pi) and x64 (qemu for now), with linux aarch64 and x64 command line interfaces à la sbcl. https://github.com/modus-lisp/modus https://github.com/modus-lisp/modus Since you can't use an OS by itself, I've rounded out the Common Lisp environment with portable ssh client and server, web browser, and a bitcoin node. Framebuffer with VNC in the pipe
- z0ltan 2mo ago[dead]
- deleted 2mo ago[deleted]
- whartung 2mo agoThat's pretty neat! God help me if I fell down a hole like that. I must say, however, that e.g. code like (compile-compound) is something only an AI can love!
- ynniv 2mo agoi've spent decades reading and writing code. i just want something that works
- BoingBoomTschak 2mo agoThere's https://scheme.fail/ https://scheme.fail/ for bare metal Lisping too.
- nobleach 2mo agoSince a few folks here recommended Common Lisp to me as the language that would "tick all my boxes", I've been doing a deep dive. Right now, I'm working through SICP again with DrRacket. The first time I worked through it with MIT Scheme MANY years ago. It's shocking how much I've forgotten. What I like about this article is that it walks through the different "camps" of Lisp. Scheme is so intriguing to me because of how small it can actually be. I can build nearly any paradigm I want to exist. The problem is, if I were to actually go find a job where they were using a Lisp, (I hear those actually exist) they wouldn't want to use my "Result monad + match statement - railway pattern" that I've used from OCaml and Rust. So learning something that is truly "common" can make more sense. As far as learning though, Scheme feels "just right". I've imposed a "no AI until I've found a working solution" rule that keeps my mind engaged. Couple that with a willingness to say, "I don't know that right now... I'll think about it throughout the day and maybe by this evening I'll have an answer".
- AyanamiKaine 2mo agoI can also recommend clojure. For me it has the best parts of common lisp and the best of the java ecosystem. But its also quite different from common lisp and scheme. Different enough to find some unique ideas. Writing scripts using [0] Babashka is also really nice. [0] https://babashka.org/ https://babashka.org/
- nobleach 2mo agoI particpated in a Clojure reading group for "Getting Clojure" back around 2017. Having the entire JVM ecosystem available, is absolutely a great benefit. I even fooled around with ClojureScript a bit. David Nolen is great at making the case for both.
- jlarocco 2mo agoOn a related note, there's a cross-platform Common Lisp package, "Bike" https://github.com/Lovesan/bike https://github.com/Lovesan/bike, that lets you use .Net assemblies from Common Lisp. I've used it a tiny bit at work (on Windows) and at home (on Linux), and ran into one issue with "out" parameters, but otherwise it works really well.
- deleted 2mo ago[deleted]
- pratikdeoghare 2mo agoShut up and learn Common Lisp using Practical Common Lisp. This would be my advice. Why? My own road was haphazard. Other books broaden your mind and teach you really cool tricks. This book gets you using lisp like you would say golang. But it still teaches you the lisp things and broadens your mind. Time spent choosing will be better spent reading this book. After that PAIP, On Lisp, SICP etc.
- mktemp-d 2mo agoPiggy backing to apply more recommendations too. An Introduction to Programming in EMacs Lisp is also good for the first few chapters even if you don’t use emacs because you are given fundamental concepts of lisp that can be applied to the understanding of other dialects. It’s also free. Learn you a Haskell (despite Haskell being not a flavor of list, they share similar DNA ) is great at understanding functional programming with lisp like languages.
- em-bee 2mo agothat's the book i learned with. it got me far enough that i was able to write two applications that i ended up using for several years.
- davidw 2mo agoWhen people have a lot of choices, that can create problems, because it's often the people with the least information trying to make that choice. For instance "I'm new to Lisp, I want to try one..." is a person without a lot of background and information to make that choice. And they probably realize it and it makes them nervous about making that choice. See: https://en.wikipedia.org/wiki/The_Paradox_of_Choice https://en.wikipedia.org/wiki/The_Paradox_of_Choice
- goatking 2mo agoI just wish a good IDE existed so I don't have to use Emacs. That's what made me drop lisp in the past. I would be happy with (neo)Vim setup as well, but that was way behind Emacs and broken when I tried.
- jacobobryant 2mo agoas of now neovim works great with clojure, not sure about other lisps. vs code also.
- goatking 2mo agoI am/was mainly interested in Common Lisp. I might give Vim another try, that would be the best if it worked. I really don't like vscode
- dieggsy 2mo agomine is a new IDE that's part of the Coalton project, but is meant to be used for Common Lisp as well: https://coalton-lang.github.io/mine/ https://coalton-lang.github.io/mine/ I have not tried it, I'm an Emacs nerd.
- ux266478 2mo agoLispWorks - https://www.lispworks.com/ https://www.lispworks.com/
- goatking 2mo agoThanks. However, price for hobby user license at 750 USD is laughable.
- aptenoforst 2mo agoYou have two newish options nowadays https://coalton-lang.github.io/20260424-mine/ https://coalton-lang.github.io/20260424-mine/ and https://lem-project.github.io/ https://lem-project.github.io/
- 2mo ago
- iFire 2mo agoSince this is the largest gathering of LISP users I have seen, I have a question. Why prefer lisp-1 over lisp-2 or vice-versa?
- dismalaf 2mo agoIMO if we look at Lisps today the question looks more like: SBCL, Chez Scheme, Racket or Clojure. Common Lisp and Racket are Lisp-2s but honestly, the namespace thing seems like a minor difference compared to all the other features that differentiate them.
- jwr 2mo agoAs someone who has used both kinds over many, many years: it really doesn't matter.
- guenthert 2mo agoHow about the distinction between the boolean value false, the empty list and whether an empty list ought to be true or false? ]:->
- Jtsummers 2mo agoIgnoring all the other distinctions between lisps, the main difference between lisp-1 and lisp-2 (or lisp-n) is going to be how clean your code looks when you lean into the FP style. In a lisp-2 you'll need to do something like this: (defun apply-twice (f x) (funcall f (funcall f x))) (apply-twice #'1+ 2) Versus this with a lisp-1: (define (apply-twice f x) (f (f x)) (apply-twice 1+ 2) ;; assuming 1+ is defined But there are so many other differences between the lisps in the two categories that this probably won't be the deciding factor for most people.
- belmarca 2mo agoGambit Scheme (https://github.com/gambit/gambit https://github.com/gambit/gambit) is a highly performant Scheme implementation (https://ecraven.github.io/r7rs-benchmarks/ https://ecraven.github.io/r7rs-benchmarks/). Gerbil (https://cons.io https://cons.io) is built on top of it. Both highly recommended.
- kscarlet 2mo agoPSA: VSCode users deserve to use the OLIVE plugin (https://github.com/kchanqvq/olive https://github.com/kchanqvq/olive).
- adamddev1 2mo agoHow to Design Programs with Racket was life changing. https://htdp.org https://htdp.org That helped me to think about recursion, functional programming, and type driven development. After going through HTDP I was able to breeze through complex problems that were unsolvable before.
- fuzztester 2mo ago>After going through HTDP I was able to breeze through complex problems that were unsolvable before. examples?
- adamddev1 2mo agoNatural language phrase generation in a very complex foreign language that follows recursive syntax trees. And making a GUI to handle and edit these syntax trees visually.
- fuzztester 2mo agothanks.
- adamddev1 2mo agoThe book takes you through simpler examples, but I found that the exercises did an excellent job of drilling a kind of recursive problem solving skill into your head. You represent the data in types, and then keep breaking the problem down into smaller functions until it is solved. It's almost magic. After being armed with this way of thinking (through lots of practice with the many exercises) I found that problems I didn't know where to begin with just melted away.
- fuzztester 2mo agothanks again. you nailed it. >then keep breaking the problem down into smaller functions until it is solved. That technique definitely works. i have used it. so have tons of others. it closely resembles the methods of structured programming and stepwise refinement. Both those terms are probably there in Wikipedia, because they are notable, being well known. and check out niklaus wirth. ditto. turing prize winner or other major awardee. pascal. modula family languages. etc.
- QuadmasterXLII 2mo agoThe funny thing about Lisp is that writing a Lisp interpreter is significantly fewer keystrokes than correctly installing Common Lisp and its tooling. The ratio of lisps to lisp programmers may actually be above 1.
- pfdietz 2mo agoLisp interpreters are easy to write; a performant and standard compliant Common Lisp system is considerably harder to write.
- zem 2mo agothis is definitely true for forth (:
- lioeters 2mo agoLiterally a comment I wrote then decided not to post. > The best LISP is the one you create yourself. You learn so much about programming by implementing your own language, and LISP is brilliant for this purpose thanks to its simple syntax and homoiconicity (code is data, data is code). It's also a great way to learn a new existing language, like Rust or Go, by writing a LISP interpreter with it.
- tmtvl 2mo agoDepends on how much tooling you want to install and where you want to be on the spectrum from: (loop :do (print (eval (read)))) to implementing all of Common Lisp in RISC-V assembly: pacman -Syu sbcl emacs M-x package-install slime RET isn't a lot of keystrokes.
- phplovesong 2mo agoThere is also MLs that have the same idea, but with less implementation, as a lisp is something you hack in a weekend. An working ML not, as it takes way more effort. Lisps have many fantastic ideas, but are really hard to read. Lisp code is what we had before perl guys went "hold my beer". I know its just syntax, and it usually does not matter, untill it does. I did some clojure a long time ago, and before that some CL, and god, i cant understand my own old code. Contrast that to some language that has syntax i can read it still, years later. Go being the prime example of write once, read a decade later.
- nathan_compton 2mo agoI find Lisp much easier to read than most other languages. It is highly explicit syntax with very little ambiguity, especially if you have a little discipline about macros.
- spdegabrielle 2mo agoI like the Python-like indentation syntax of Rhombus. It has the extensibility of a modern lisp https://rhombus-lang.org/ https://rhombus-lang.org/
- prakashrj 2mo agohttps://www.youtube.com/watch?v=LXhsutNKhec&feature=youtu.be https://www.youtube.com/watch?v=LXhsutNKhec&feature=youtu.be Once you get hang of it, it easy. Following is video of my son who learnt Scheme as first programming language.
- spdegabrielle 2mo agoIf you want the extensibility of Lisp with a readable syntax Rhombus is worth a go https://rhombus-lang.org/ https://rhombus-lang.org/
- PaulHoule 2mo agoI'm going to take the opposite position that there is much less special about Lisp than people think. Like I have met so many programmers that travel around like itinerant martial artists looking for true functional programming and they never find it. To be specific, you can work all of the examples in Graham's On Lisp in Python except for one of the last chapters where he implements continuations that really need macros -- but this is basically the async/await facility that Python already has. The other examples use macros for performance but work fine with just plain functional programming. React with hooks is an example of that kind of system at work -- the JSX transformation is a very simple shim you can put in front of the JS compiler and the hooks themselves are the kind of trick that On Lisp teaches you how to do. On Lisp doesn't use the kind of tree-walking macros that really are unique to Lisp. And... the techniques in the Dragon Book for writing compilers are the real magic. If looking to Lisp as an old shiny keeps you from learning how to write compilers, it is holding you back. I think the homoiconic thing leads people astray. There's a real tension that, for performance reasons, mainstream compilers aren't extensible, for instance you might want to write a unless(X) {...} => if(!X) {...} control structure in a new language and for something in Java that is really a production rule in the grammar, maybe a class to represent the unless block, and a rewriting rule that gets applied to the AST. If the compiler was designed to be easily extensible that would be less code than the POM file for the project. But it's not so it isn't. Many things hold us back. The industry has been so traumzatized by slow compiles that trading speed for extensibility doesn't sell to the people who create languages. Also once you have the sophistication to make things like parser generators you know how to get things done with the terribly unergonomic parser generators we have and don't have a lot of empathy for all the programmers out there who might be using parser generators if any of them were built as if usability matters.
- pjmlp 2mo agoExcept that CPython still misses on (compile .....) part, indeed holding the industry back.
- PaulHoule 2mo agoit compiles to bytecode but the bytecode engine is not that fast. i had a phase when I was using PyPi a lot for branchy "old AI" kinds of workloads and felt it was an easy win but since then it has been either numpy or PIL or pytorch doing the heavy lifting or scripty stuff like uploading files to S3 where performance doesn't matter a lot. I will grant that Common Lisp can be compiled to run amazingly quickly!
- arikrahman 2mo agoAll roads lead to Lisp
- phtrivier 2mo agoFrom my experience, to be happy I would need the perf of sbcl, the syntax, litterals and data structure of clojure, the begginer-friendlyness of drracket, the type system of ocaml, and the dev experience of rust. Does that exist somewhere ? I hope jank gets there. Or maybe roc will. At this point, given the progress and expectations of using LLM, writing code is going to be purely a hobby concern, like carving wood furniture became a hobby once you have Ikea. So we might as well use fun tools :)
- totalperspectiv 2mo agoCarp has been slowly inching forward and ticking those boxes
- SomeHacker44 2mo agoPlease say more about the "dev experience of rust." As a long time Lisper and not much of a Ruster, I found the dev experience very painful. Granted, I expect had I continued using Rust that would have abated in tjme. I also disliked Clojure at first until I became comfortable with it and productive, before coming to like and appreciate it.
- deleted 2mo ago[deleted]
- phtrivier 2mo ago- a single, canonical, sanctified toolchain for "all the things that are require but don't matter" What's the "cargo xxx" of lisp ? It depends. Maybe it's "quicklisp something". Maybe it's "ASDF something". Maybe it's a mixture of three different things and you ask a dumb question on SO that should be in the first page of the manual, and you get 10k views : https://emacs.stackexchange.com/questions/83200/given-a-brand-new-asdf-project-how-do-i-get-a-loaded-system/84945#84945 https://emacs.stackexchange.com/questions/83200/given-a-bran... I know, you enjoy the power of having options, configuring everything, and shaving your yaks to the bone with macros over macros. But I suspect you never hear of so many questions about "retro antagonist polymorphic macros over monadic functional arrowd", because people give up at "how do I import a lib to make an http call" ? - a single, standard and opinionated way to lay your frigging files on your effing disk. "cargo new". And, no, it should NOT require people to create a top level "common-lisp" folder to store all their projects. - adding and loading deps. Sorry, typing quicklisp:xxxx in every repl session you open is not "cargo add". - a baked in way to run some sort of unit test suite. Have dozens of options if you want, but what is the "cargo test" ? Of course all those problems have been solved by various tools somewhere in 1997, so it will sound like an "entitled millennial" comment. But, soon, the tagline to aim for will be "a lisp for the 100 years of lisp". What's that ?
- Octplane 2mo agoI came here to see Janet mentioned and I am a bit sad :) https://janet-lang.org/ https://janet-lang.org/
- dmux 2mo agoI'm surprised there's no call out highlighting Common Lisp and Clojure's "liveness" compared to Racket (and Scheme). Racket is "batch compiled" wherein CL and Clojure you're editing a live image.
- SilentM68 2mo agoRacket's top dog in my book :)
- zem 2mo agoapart from anything else it has a really beautiful object system. I feel like racket and ocaml are two languages where the object system doesn't get enough love.
- lgrapenthin 2mo agoChoose any LISP, and the right LISP will choose you.
- xvilka 2mo agoCommonLisp really should evolve to update the language up to the modern standards and become more functional and better typed.
- kanbankaren 2mo agoIt is already typed. Types are optional. I think types have been available for the last 30 years? Check the specs.
- xvilka 2mo agoI wrote "better typed", not just "typed".
- tmtvl 2mo agoIt is typed, but it's not very well typed. List is 'null or cons' for instance, not 'null or (cons * list)'. Also lack of generics so you can't have a class which holds an element of a generic type which can be determined later on in the compilation process (e.g. a weight-balanced tree which holds elements of a given type).
- ozhero 2mo agoFor someone who knows nothing about Lisp I found this an excellent article. Motivates me to learn more about Lisp (and Clojure)
- vindarel 2mo ago> Common Lisp lacks some conveniences that have become common in newer languages, such as concise literals for a wider variety of data structures, persistent immutable collections, lazy sequences and built-in general-purpose pattern matching. we can explore libraries on https://github.com/CodyReichert/awesome-cl/ https://github.com/CodyReichert/awesome-cl/ concise literals: serapeum's dict or other libraries bring you { } for hash tables and the like. persistent collections: FSet (and more) lazy sequences: series, gtwiwtg (generators) (and more) pattern-matching: Trivia many libraries are shipped in CIEL: https://ciel-lang.org/ https://ciel-lang.org/ (shameless plug) --- > It’s currently used in … more example companies: https://github.com/azzamsa/awesome-lisp-companies/ https://github.com/azzamsa/awesome-lisp-companies/ also: https://lisp-screenshots.org/ https://lisp-screenshots.org/ --- > at the cost of slightly slower startup times that means ±30ms, not the Java-esque slow startup time ;) --- editors: don't miss https://lispcookbook.github.io/cl-cookbook/editor-support.html https://lispcookbook.github.io/cl-cookbook/editor-support.ht... and the new Mine, OLIVE for VSCode, ICL repl (terminal and browser).
- birdfood 2mo agoI'm really quite drawn to lisp (in general) but I keep bouncing off it. I think the main reason is I just don't know how to effectively work with a dynamically typed programming language. I think for me the affordances that a language provides to change a program over time matter much more than the features that aid in writing programs. I want to know before I run my program whether my program is sound. I appreciate what other people are able to do with lisp(s) and I want to experience that for myself. But I think what I need is to let go of having a compiler yell at me when I remove a field from a type but that I still have functions that expect that field (for example). Is it just more tests? Live REPL editing? It seems like this can only cover so much surface area compared to compile time type checking. I don't think statically typed languages are better than dynamic ones or vice-versa. I just am not as effective with the dynamic ones.
- jasonm23 2mo agoReally should include Emacs lisp, as it's a something many in academia happen upon for LaTeX or some other side use. While Emacs Lisp is confined to the editor, it also shows that the Editor is not that, and much has been said of it as an OS, an Application Platform, and so on. Since about 1992, I've used it as platform for many things as well as a general purpose text editor I couldn't initially figure out how to quit. I'm sure many here are more fervent about Emacs, living in the terminal switched to living in Emacs for a lot of folks... that's really a testament to the usability gravity of an integrated computing platform with Lisp as it's only scripting language. ymmv of course
- cyrc 2mo agoFor those who are interested in common lisp There is a very nice IDE called Mine https://coalton-lang.github.io/20260424-mine/ https://coalton-lang.github.io/20260424-mine/
- iFire 2mo agoAnyone have lisp commentary on https://github.com/janet-lang/janet https://github.com/janet-lang/janet?