News for hackers. Stuff that matters.
Re:Relic: Functional relational programming for Clojure(Script) by brap on Sunday February 26, 2023 @06:15PM (#34950743)
What makes people see Lisp-like languages and think to themselves "yep, this is how I want my code to look like" is beyond me
Re:Relic: Functional relational programming for Clojure(Script) by tmtvl on Sunday February 26, 2023 @06:19PM (#34950789)
I like the structure that S-expressions convey. Must be something with how my brain works. It's probably also why I find Python code utterly unreadable.
Re:Relic: Functional relational programming for Clojure(Script) by brap on Sunday February 26, 2023 @06:25PM (#34950848)
To each their own. There are obviously very smart people choosing Lisp so I’m not trying to knock it down or anything, I just never got the appeal

Every now and then I try to check out a Lisp project and this is my reaction the moment I see the code: https://giphy.com/gifs/seinfeld-bye-jerry-106PwpLIIXJnXi

Re:Relic: Functional relational programming for Clojure(Script) by vindarel on Sunday February 26, 2023 @06:53PM (#34951114)
This is what we see: https://raw.githubusercontent.com/tarsius/paren-face/master/...

Don't look at the parens and don't stop at the superficial look :]

Re:Relic: Functional relational programming for Clojure(Script) by dgb23 on Monday February 27, 2023 @03:16AM (#34954205)
For me much of the appeal of the syntax comes from using it with a editor integrated REPL, or when writing macros, or when generating linter configuration from a domain model etc.

However I agree with you on some level. Lisp code can easily be written in a way that’s hard to read. Specifically because of nesting expression way more often than is comfortable for me to read. I much rather prefer let bindings and threading so most of the code reads from left to right.

Re:Relic: Functional relational programming for Clojure(Script) by rawoke083600 on Monday February 27, 2023 @05:37AM (#34954909)
>To each their own. There are obviously very smart people choosing Lisp so I’m not trying to knock it down or anything, I just never got the appeal

Just know that almost no one STARTS off by liking Lisp-Syntax, but oh boy does it grow on you.

Re:Relic: Functional relational programming for Clojure(Script) by michaelteter on Monday February 27, 2023 @07:35AM (#34955664)
In most cases, an imperative example in a curly-bracket language (JavaScript as one example) has the same number of parens and curly brackets as a Lisp has in parens. They're just in different places.

And, the non-Lisp languages tend to have more rat droppings => , ; . etc.

f is a function which takes two arguments, adds them, and returns the result.

Clojure: (def my-var ["hello" 123 (f 10 20)]) -> my-var: ["hello" 123 30]

([""()]) -> 8 noisy characters

JavaScript: const my_var = ["hello", 123, f(10, 20)]; -> myVar: ["hello", 123, 30]

=["",,(,)]; -> 11 noisy characters

Obviously this difference becomes more pronounced with longer argument lists or array element counts.

Re:Relic: Functional relational programming for Clojure(Script) by Lyngbakr on Sunday February 26, 2023 @06:31PM (#34950903)
I totally agree with this, but my love of Lisps wasn't instantaneous. When it clicked though — which required some effort — and I could appreciate the elegance of the language, I didn't want to use anything else.

Regarding Python, I've always disliked its functional whitespace and OO inclination. Given its popularity, though, I'm clearly a minority!

TL;DR — to each their own.

Re:Relic: Functional relational programming for Clojure(Script) by michaelteter on Monday February 27, 2023 @07:21AM (#34955586)
For me, S-expressions remove a whole layer of stuff to think about and remember. It normalizes everything.

And you get the bonus of being able to construct or parse code from within code, since the structure is so uniform and flat.

Re:Relic: Functional relational programming for Clojure(Script) by capableweb on Sunday February 26, 2023 @06:47PM (#34951048)
We (professional developers using lisp-like languages daily) don't have the reaction of "ewww" as soon as we see something foreign, but instead we think "hmm, that looks different, I wonder why it looks different?" and then we start to try to understand it. Then you give a lisp-like language a try (Clojure in my case) and suddenly it's really hard to program in any other language, because they're not as good as a lisp language.

If you have a knee-jerk reaction to everything that looks different, you'll lose out on lots of fun stuff. You should give lisp a try, I'm sure you won't regret it.

Re:Relic: Functional relational programming for Clojure(Script) by beepbooptheory on Sunday February 26, 2023 @08:27PM (#34951874)
Lispey stuff self-selects its fans quite nicely in this way.
Re:Relic: Functional relational programming for Clojure(Script) by simula67 on Monday February 27, 2023 @01:07AM (#34953553)
But is there any need to make things different for the sake of difference?

For example, why not name "car" function as "first", "head" or "beginning"? Why not name "cdr" as "rest", "tail", "end" or "back"?

Re:Relic: Functional relational programming for Clojure(Script) by Skinney on Monday February 27, 2023 @01:20AM (#34953625)
LISP was one of the very first high order programming languages (came around the same time as FORTRAN).

If anything, other languages are different for the sake of being different.

Btw, Clojure makes those exact changes you mention (first instead of car etc.)

Re:Relic: Functional relational programming for Clojure(Script) by kazinator on Monday February 27, 2023 @01:56AM (#34953820)
CAR and CDR have origins in a hardware feature of the IBM 704. But they came into Lisp via Fortran. The list processing in Lisp was closely inspired by FLPL: the Fortran List Programming Language: a system for linked list manipulation done in Fortran. FLPL had functions like XCARF and XCDRF and others. MacCarthy greatly improved the naming by dropping the gratuitous X...F noise. (What had they been thinking?)
Re:Relic: Functional relational programming for Clojure(Script) by lispm on Monday February 27, 2023 @07:47AM (#34955762)
> Clojure makes those exact changes you mention

roughly 25 years after Common Lisp introduced first,..,tenth, and rest

Re:Relic: Functional relational programming for Clojure(Script) by filoeleven on Monday February 27, 2023 @01:43AM (#34953759)
Clojure uses “first” and “rest”, as does Racket.
Re:Relic: Functional relational programming for Clojure(Script) by kazinator on Monday February 27, 2023 @01:52AM (#34953802)
Grandparent programs in Clojure which doesn't use car and cdr.

ANSI Common Lisp has first and rest as synonyms of car and cdr. Books from the middle 1980s on the then emerging Common Lisp already cover this.

It's like you're griping about an issue that was closed before CVS existed, let alone git.

car and cdr still exist because of backward compatibility and because they are good names for when cons cell structure is just arbitrary structure and not a list. The car is not always the first item of a list, and cdr is not always the continuation of a list. These words are deeply entrenched in the Lisp culture. The words have no confusing associations with anything else but the parts of a cons cell. I've not come across any "car" or "cdr" usage in computing anywhere, except Lisp-inspired jokes like in the "Locator/Identifier Separation Protocol". In the telecomm industry, CDR stands for "call detail record", but that's removed from programming language and data structuring.

Knuth defined some binary-cell tree structures in TAOCP. He used the words alink and blink (as in A link, B link). Those words are not bad.

It's good if the parts of a flexible data structure that programs use for representing all kinds of things have names that don't have any confusing associations. When you see those names, you know they are just literally about that structure, and you can see from how those words are used what the shape of the structure is.

Re:Relic: Functional relational programming for Clojure(Script) by kazinator on Monday February 27, 2023 @01:34AM (#34953701)
* * *
Re:Relic: Functional relational programming for Clojure(Script) by rawoke083600 on Monday February 27, 2023 @05:35AM (#34954899)
^^^ That is like someone went back in time and gave the Egyptians a typewriter but only installed "The Windings Font" :)

The magic of S-Expr is like drug-addiction... someday you wakeup and realise... damnn I can't go without S-Expr in my daily-driver-languages :/

Re:Relic: Functional relational programming for Clojure(Script) by rawoke083600 on Monday February 27, 2023 @05:32AM (#34954876)
>If you have a knee-jerk reaction to everything that looks different, you'll lose out on lots of fun stuff. You should give lisp a try, I'm sure you won't regret it.

Yes I always tell ppl, sure you don't need to like LISP but as a serious CS professional, AT LEAST give it a real HONEST go! Then if you still don't like it, cool, move on !

There is an active and lively and long-lived LISP-Like community even today, there is a high probability there is something there.

YMMV :)

Re:Relic: Functional relational programming for Clojure(Script) by yogthos on Sunday February 26, 2023 @08:06PM (#34951734)
What makes people see non-Lisp-like languages and think to themselves "yep, this is how I want my code to look like" is beyond me
Re:Relic: Functional relational programming for Clojure(Script) by chitowneats on Sunday February 26, 2023 @10:50PM (#34952732)
What a sad and childish way to look at machine instructions. Did you like broccoli the first time you ate it?

Consider that others have learned something that you haven't. Act accordingly. You might disagree in the end, but to confidently state things like, "it's ugly, I don't get it", is only to your detriment.

If you have specific concerns please enumerate them. There's no char limit here on HN.

Re:Relic: Functional relational programming for Clojure(Script) by rawoke083600 on Monday February 27, 2023 @05:29AM (#34954864)
What I noticed is, that in the beginning most people (including me) think like this. It's like ()-SOUP !

Then suddenly after a month or so you suddenly realise wow, this is actually nice and useful and now all other non S-Exp feels jukky.

You get to that point NOT because you are now simply enduring/accepting that it looks ugly but it really after a while becomes pretty !

It's like picking up smoking, no one likes the first or two cigarettes at first, it taste like sht, yet if you keep doing it becomes lovely. *

PS. Don't smoke kids !

Re:Relic: Functional relational programming for Clojure(Script) by blatant303 on Tuesday February 28, 2023 @05:47AM (#34967901)
"Syntactic sugar causes cancer of the semicolon."

Alan Perlis

Re:Relic: Functional relational programming for Clojure(Script) by michaelteter on Monday February 27, 2023 @07:17AM (#34955550)
There are many incredible foods that we cannot imagine putting in our mouth as children, but usually we grow up and discover how wonderful they are.
Re:Relic: Functional relational programming for Clojure(Script) by butternoodle on Monday February 27, 2023 @10:32AM (#34957572)
To each their own! I feel the same way about Algol family languages, too many arbitrary design decisions that have been internalised for decades at this point for my liking.