Live data from Hacker News

Differences with other Lisps

clojure.org

51–60 of 108 posts

Re: Differences with other Lisps

#51
I've been messing with Clojure/ClojureScript for a few years having previously had zero Lisp experience. Overall, I think Clojure does a good job of being both practical and lispy. It's a language that is for building real things.

I've been focusing on ClojureScript (https://clojurescript.org/) as you get the benefit of interoperating with the Javascript ecosystem. The fact that there's a strong community around both Javascript hosted and Java hosted gives a wealth of library options.

Overall, the tooling has been getting a lot closer to the sort of experience that contemporary developers expect. The Calva plugins integration with Visual Studio (https://calva.io/) makes it easy to get started - you can even run it online with gitpod (https://github.com/PEZ/rich4clojure).

That just leaves learning the language - the slight changes in syntax (brackets for different data types) definitely help early on, and for the most part Clojure discourages people going down the path of macros which means reading other peoples code is reasonably accessible. The main struggle is that it's a language used by a lot of advanced or full-time developers, so documentation is pretty dense and it can take a real commitment to understand the detail.

It may not be 'correct' enough if you're coming from other Lisps, but coming the other way from C/Python etc I've found it an accessible and practical option.

Re: Differences with other Lisps

#52
post #45

Maybe a more seasoned LISP-`aterian` can answer me ? I'm in the process of learning ClojureScript - real fun so far. I have of course also looked at other LISPs and have noticed that in CJS the use of square brackets[] for vectors, let and `function params` (defn myfunc [] (let [some-var (:some-key some-state)]) (.log js/console some-var) ) I almost never see square brackets in other LISPs (yes I'm truly a beginner a…

Using [] for syntax like Clojure does is kind of weird and not too consistent IMO. As for data structures, CL has vectors (and more complex arrays), with #() as a literal syntax or my preference just the function (vector ...). But beyond that, CL is just not nearly as opinionated as other languages. You are free to define a function named [] as a wrapper around aref, if you wanted to write things like ([] array index…

> Using [] for syntax like Clojure does is kind of weird and not too consistent IMO

Actually, it’s very consistent. Round parentheses are used for syntax where the first element is a “command” that will be evaluated, and square brackets are used for list of things where the first element is not “special”.

For example, in `(let [x 0 y 1] (conj [2 y] x))`

- `let` and `conj` are commands that will be evaluated, and the rest of the syntax list are arguments to that command

- `x` and `2` are not commands to be evaluated, they are just members of the syntax list with no special evaluations.

The only inconsistency with this rule that comes to my mind is `case` with multiple matches, but outside of that it’s pretty consistent, and I started to like it after it “clicked” in my head.

Re: Differences with other Lisps

#53

I've been messing with Clojure/ClojureScript for a few years having previously had zero Lisp experience. Overall, I think Clojure does a good job of being both practical and lispy. It's a language that is for building real things. I've been focusing on ClojureScript ( https://clojurescript.org/ ) as you get the benefit of interoperating with the Javascript ecosystem. The fact that there's a strong community around bo…

Visual Studio Code, and yes Calva is nice.

Re: Differences with other Lisps

#54
post #36

Earlier quoted context omitted.

It is, a friend built a consultancy doing PHP, and they have enough work to keep them going, keep the lights on, and focus on other stuff relevant to them. PHP would actually be (1998...n), PHP 3 was when it took off.

>PHP would actually be (1998...n), PHP 3 was when it took off. Yea was wondering what to put as a start date, I decided on the year I left varsity and walked into my first "professional job" coding C++ (Borland C++ Builder) within 6 months, we changed the "C++ Server" with Apache and some wacky PHP files. But you are right :)

If you miss those days you can have a go at RAD Server. :)

https://www.youtube.com/watch?v=HY0JRJPvjsU&list=PLwUPJvR9mZ...

Re: Differences with other Lisps

#55

Maybe a more seasoned LISP-`aterian` can answer me ? I'm in the process of learning ClojureScript - real fun so far. I have of course also looked at other LISPs and have noticed that in CJS the use of square brackets[] for vectors, let and `function params` (defn myfunc [] (let [some-var (:some-key some-state)]) (.log js/console some-var) ) I almost never see square brackets in other LISPs (yes I'm truly a beginner a…

IIRC, creator of Clojure, Rich Hickey once said that people in general handle things better where there is some variety in symbols used for different things, when you "scan" the code with your eyes. Too much variety -> you end up with explosion of symbols and operators, not good; too little variety -> hard to distinguish things.

Re: Differences with other Lisps

#57
post #38
post #33

Earlier quoted context omitted.

The reality is that just about every single lisper will insist how they don't see the parenthesis and they are not a problem, and just about every single lisp has some ugly ad hoc hacks to reduce their clutter. They just differ somewhat between lisps. Scheme (and descendants like racket) went so far as to make [] and () interchangeable. So you will in fact see brackets in some scheme most e.g. (let ([a 1] [b 2]) ...)…

Only R6RS made () and [] interchangeable. That was hugely controversial, with opponents (myself included) thinking it was a waste of 1/3 of the matching pair symbols. And the suggested use was not quite the syntax you showed: http://www.r6rs.org/final/html/r6rs-app/r6rs-app-Z-H-5.html

> a waste of 1/3 of the matching pair symbols

I count 5, (), [], {}, and /\ though the last one is a bit of a stretch (but it's reversible: \/). Am I missing something? Did you mean "1/3 of the matching pair symbols left" as () is already used? Or is not usable?

Re: Differences with other Lisps

#58

In many ways I feel like Clojure is a better Lisp than Lisp itself. Syntactic niceties like support for vectors/maps/sets are, once you've gotten used to them, hard to do without. And although it's orthogonal to the syntax, I also appreciate its focus on immutability. I just with there was a Lisp like it that didn't run on the JVM.

> I just with there was a Lisp like it that didn't run on the JVM. There are a few, with varying degrees of distance from the JVM and varying degrees of similarity to Clojure. - There's ClojureScript, which is Clojure transpiled to JavaScript. - See also Lumo ( ) and Planck ( ) - There's Babashka ( https://github.com/babashka/babashka ), which is a natively-compiled Clojure interpreter, implemented with the Small Clo…

I'm surprised to see no Clojure built on Go. Is there a technical reason why this wouldn't be a good idea?

Re: Differences with other Lisps

#59

Earlier quoted context omitted.

As someone that was a hardcore Lisper (you could find me arguing that Scheme is not a Lisp, etc.) before adopting Clojure: I thought muddying the language with a new kind of syntax was terrible. I don't suggest that this is what primarily drove the lack of adoption of other kind of braces but I, as a follower of the church of Lisp, had an immense dislike of the lack of purity. In the end vector and map "syntax" is ju…

>A pragmatic Lisp.. As a newbie(with zero social-capital) I couldn't agree more !

Well I mean CL is absolutely littered with pragmatism it came out of a standard committee after all. In many ways I'd argue clojure is far more opinionated, it's just an opinion that might more closely align with modern sensibilities.

Re: Differences with other Lisps

#60

I've been messing with Clojure/ClojureScript for a few years having previously had zero Lisp experience. Overall, I think Clojure does a good job of being both practical and lispy. It's a language that is for building real things. I've been focusing on ClojureScript ( https://clojurescript.org/ ) as you get the benefit of interoperating with the Javascript ecosystem. The fact that there's a strong community around bo…

> Overall, I think Clojure does a good job of being both practical and lispy. It's a language that is for building real things.

As opposed to? Common Lisp and Emacs Lisp are both highly practical. Scheme you might call more academic, but that's not really what people think of when they say "Lisp".

Post reply on HN