I have really fallen in love with LISP recently, specifically clojure. A strong type system is really needed for it to make me feel like I can confidently develop with it.
Are those compile-time type checks or runtime assertions?
rjsw · 5h ago
Your eli looks clunky to me.
codr7 · 5h ago
Well, use something else.
And maybe ask yourself why you felt saying so was important to you.
dokyun · 4h ago
(the number (+ 35 7))
is a lot less clunky than
(+ 35 7)@Numeric
codr7 · 4h ago
That's your opinion, I don't agree.
And the other reason is I can use the same syntax wherever I want type checking.
epgui · 24m ago
Opinions aside, it is objectively an increase in syntactical complexity, and many people who love lisp enjoy its relative syntactical simplicity.
Whatever is gained in exchange for this additional syntactical complexity may not be valued in the same way by everyone.
So that almost certainly explains that reaction.
HexDecOctBin · 4h ago
One problem with Lisp is everything, including variable bindings, increases the nesting level making the code illegible. Last thing you want is for the type declaration to have their own nesting.
epgui · 33m ago
The nesting level doesn’t necessarily impair legibility, it depends how it’s done. Nesting levels in homoiconic & referentially transparent languages have an impact more comparable to nesting levels in yaml or json than nesting levels in a language like python or javascript. The tradeoff weighs in a completely different way.
First you will usually want to write small chunks of code, instead of a large soup.
Second, you can make intentional decisions with your use of newlines in order to highlight specific aspects of the code.
I find clojure more readable than most other languages… However, bad code stands out horribly (which is actually great if you have at least one experienced engineer in the team- I’d argue there’s nothing worse than bad code that looks normal). Just like anything else, writing good lisp takes some skill.
Your specific editor and its configuration will also have a big impact on your experience.
dokyun · 35m ago
If you hate nesting, just do this
(defun foo (&aux bar baz)
(setq bar (quux)
baz (xyzzy))
...)
zarathustreal · 3h ago
This is not necessarily true, you can pretty easily implement just about any syntax you want
gitroom · 3h ago
honestly i kinda love when deep dives like this pop up, makes me rethink stuff i thought i'd settled on - you think things ever get simple with lisp or it always stays quirky no matter how you do it
NikkiA · 5h ago
praising 'loop' in the same post as describing lisp as 'elegant' shakes head
codr7 · 5h ago
Some people seem to like it, and be very effective using it.
The problem is it's a walled garden, with its own quirky syntax; nothing that happens inside of loop is applicable outside, and the other way around.
kagevf · 4h ago
My opinion of LOOP started to change when I read (the much maligned) "Land of Lisp" and went over that "periodic" diagram in TFA. Seeing the elements of LOOP broken down like that went a long way to get me to overcome my original aversion to it.
I feel bad for people who haven't discovered ITERATE yet.
Jach · 1h ago
I'll never understand the love for iterate. Look at these comparisons: https://github.com/sabracrolleton/sabracrolleton.github.io/b... For almost all of them, it's the same guy, just more parens. Nothing to love/hate for one or the other, it's just preference, though one is built-in.
Jtsummers · 4h ago
ITERATE still breaks when you use `count` inside it, the built-in CL function. If they ever address that problem I'll get back to use it but having a time bomb in my programs isn't something I like.
Trivial example of breakage:
(iter (for i from 1 to 10)
(print (count i some-sequence)))
shawn_w · 4h ago
Breaks how? I'm on my phone, not a computer right now and can't test, but that should call the CL function - ITERATE uses `counting` for that particular operation to avoid conflicts; see https://iterate.common-lisp.dev/doc/Gathering-Clauses.html
Or is the documentation wrong?
Jtsummers · 3h ago
Apparently this is a quicklisp problem, they haven't updated the release since 2021 when it was still broken.
shawn_w · 2h ago
I just grabbed the latest ITERATE source off of its gitlab repository, and, yeah, that bit is still giving an error:
Iterate, in (COUNT I SOME-SEQUENCE): Missing value for SOME-SEQUENCE keyword
as well as
WARNING:
COUNT appears to be used as an ITERATE clause keyword, in this sexpression: (COUNT I SOME-SEQUENCE).
This use is now deprecated and will cease to be supported in a future version. Please use the alternative keyword COUNTING instead. If you intended COUNT to be interpreted as a function call, instead of an ITERATE clause, you must find an alternative way of calling it, at present, perhaps by using FUNCALL or APPLY.
Have to use
(iter (for i from 1 to 10)
(print (funcall #'count i some-sequence)))
Guess the documentation /is/ wrong (for now, until the code finishes catching up)
Jtsummers · 2h ago
Well, some-sequence was obviously an example, you'd have to fill it in with an actual sequence. Put in '(1 2 3) instead or assign something to it.
But yeah, that's still not something I intend to use if they make you work around what should be plain Common Lisp.
shawn_w · 2h ago
I had a some-sequence variable defined.
(Using a literal list or vector gives a different error)
I made an attempt to fix that for eli: https://github.com/codr7/eli#type-checking
And maybe ask yourself why you felt saying so was important to you.
Whatever is gained in exchange for this additional syntactical complexity may not be valued in the same way by everyone.
So that almost certainly explains that reaction.
First you will usually want to write small chunks of code, instead of a large soup.
Second, you can make intentional decisions with your use of newlines in order to highlight specific aspects of the code.
I find clojure more readable than most other languages… However, bad code stands out horribly (which is actually great if you have at least one experienced engineer in the team- I’d argue there’s nothing worse than bad code that looks normal). Just like anything else, writing good lisp takes some skill.
Your specific editor and its configuration will also have a big impact on your experience.
The problem is it's a walled garden, with its own quirky syntax; nothing that happens inside of loop is applicable outside, and the other way around.
Trivial example of breakage:
Or is the documentation wrong?
But yeah, that's still not something I intend to use if they make you work around what should be plain Common Lisp.
(Using a literal list or vector gives a different error)