Top
Best
New

Posted by silcoon 8 hours ago

A Road to Lisp: Which Lisp(scotto.me)
149 points | 97 commentspage 2
iFire 5 hours ago|
Since 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?

Jtsummers 4 hours ago||
Ignoring 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.
zem 1 hour ago|||
personal taste, for the most part. I like the thought of a single namespace, it fits my intuition from pretty much every other language out there, and I like how the code looks when I can pass functions around as though their names are regular variable bindings to an underlying function object.
wk_end 4 hours ago|||
The argument is: if you don’t have hygienic macros, a Lisp-2 is going to be less brittle than a Lisp-1.

The classic example is, imagine you have a function with a local variable called “list”, common enough. Now imagine you invoke a macro inside that function which generates a call to the built-in “list” function - also common enough. In a Lisp-1 without hygiene that breaks - your local definition shadowed the built-in; in a Lisp-2 or hygienic Lisp-1 you’re in the clear.

Jtsummers 3 hours ago|||
@nathan_compton, your sibling comment to what I'm writing now is [dead] (not [flagged]) but you're not shadowbanned, newer and older comments are still alive. I vouched for it but it's still [dead], you may want to reach out to the mods.
nathan_compton 3 hours ago|||
People should never use non-hygienic macro systems anyway, but even if they are using a non-hygienic macro, they should always use proper hygiene. Its kind of dumb to make the whole system weirder just to avoid issues which should never happen in the first place, in my opinion.
jwr 5 hours ago|||
As someone who has used both kinds over many, many years: it really doesn't matter.
sph 1 hour ago|||
Having a separate namespace for functions is silly in that it only saves you from a small set of variable shadowing problems. It’s a hack, not a serious solution.
nathan_compton 3 hours ago|||
I am a strong proponent of Lisp 1, primarily because the distinction between functions and other types of values is artificial. Functions have first class semantics in Lisp 1 and Lisp 2, but Lisp 2 makes you denote them differently but in an inconsistent manner.

Lisp 2 advocates typically make a few arguments. One is that having a separate namespace for functions makes it clearer when you are using a function vs another value. The second is that the evaluator has less work to do when examining the head of a list - it needs only look in the function environment, not the full environment.

On the first subject I must disagree - you can bind a function to a regular variable and then use that variable everywhere (except in the car of a list representing a function call), so for most positions in a set of expressions you don't really get information about whether the object being denoted is a function or not.

I suppose the second point is somewhat valid, though I suspect if you benchmarked interpreters and compilers it would barely matter. As a person who favors functional programming with a lot of combinators, I find Lisp 2 introduces a lot of pointless noise in the syntax for no reason. And I fundamentally just don't see functions as significantly different sorts of values, so I find the syntactic distinction bizarre.

dismalaf 5 hours ago||
IMO 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.

gus_massa 4 hours ago||
[Racket is a lisp-1.]
dismalaf 3 hours ago||
Sorry was thinking of Racket having keywords like Common Lisp, whereas Chez doesn't.
belmarca 5 hours ago||
Gambit Scheme (https://github.com/gambit/gambit) is a highly performant Scheme implementation (https://ecraven.github.io/r7rs-benchmarks/). Gerbil (https://cons.io) is built on top of it.

Both highly recommended.

avph 2 hours ago||
I recently started looking at https://github.com/elle-lisp/elle . It's made with AI but has an interesting feature set.
kscarlet 4 hours ago||
PSA: VSCode users deserve to use the OLIVE plugin (https://github.com/kchanqvq/olive).
goatking 5 hours ago||
I 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.

aptenoforst 23 minutes ago||
You have two newish options nowadays

https://coalton-lang.github.io/20260424-mine/ and https://lem-project.github.io/

ux266478 4 hours ago|||
LispWorks - https://www.lispworks.com/
goatking 4 hours ago||
Thanks.

However, price for hobby user license at 750 USD is laughable.

jacobobryant 5 hours ago||
as of now neovim works great with clojure, not sure about other lisps. vs code also.
goatking 4 hours ago||
I 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 3 hours ago||
mine 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/

I have not tried it, I'm an Emacs nerd.

hnarayanan 7 hours ago||
So many words to say: Scheme.

:)

nobleach 6 hours ago||
Perhaps, but Chicken? Guile? Chez? They're all pretty cool.
tmtvl 5 hours ago||
R5RS, R6RS, or R7RS?
nathan_compton 3 hours ago||
R6RS.
criddell 7 hours ago||
Another 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 6 hours ago||
I had forgotten about this. The last I saw this was 20+ years ago!
timonoko 4 hours ago||
Adding 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.

xvilka 2 hours ago||
CommonLisp really should evolve to update the language up to the modern standards and become more functional and better typed.
kanbankaren 1 hour ago|
It is already typed. Types are optional. I think types have been available for the last 30 years? Check the specs.
Octplane 3 hours ago||
I came here to see Janet mentioned and I am a bit sad :)

https://janet-lang.org/

wollowollo 6 hours ago|
I wonder if Hylang is still alive.
bbkane 5 hours ago|
There's also Rhombus now: https://docs.racket-lang.org/rhombus-quick/index.html
More comments...