Live data from Hacker News

Differences with other Lisps

clojure.org

71–80 of 108 posts

Re: Differences with other Lisps

#71
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

The use of square brackets in Lisp and Scheme is much older. IIRC there were Scheme books which used them much earlier.

Interlisp also for example uses square brackets. The left square bracket is equivalent to a round bracket and the right square bracket closes all open levels of brackets.

Re: Differences with other Lisps

#72

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…

I've read that Clojure(Script) has a great REPL experience. Even when using VSCode, can one use the REPL easily?

Yes, it looks like Calva has first-class support for launching REPLs from your project, or for attaching itself to a REPL session that was launched in some other way: https://calva.io/connect/

Re: Differences with other Lisps

#73
post #67
post #66

Earlier quoted context omitted.

CL is not really highly practical. The stdlib is not very coherent and lackluster in general (do I really need to import external code to split a string?), the commonly accepted package manager is in an eternal beta limbo, the whole QL/ASDF/... thing is clumsy, parallel/concurrent libraries are very low-level, etc. Now SBCL in itself is rock-solid and a fantastic experience when used with emacs, but the CL ecosystem…

The commercial Common Lisp I use, also has large amounts of extensions to CL. Including a function to split sequences/strings, parallel and concurrent extensions, ... ;-) It's actually the same commercial Common Lisp which Rich Hickey used years ago to write his first Lisp programs and where he developed his first ideas for Clojure.

Are you working under an NDA or something? Are you being threatened? Blink three times if you need help.

Seriously, is there a reason you have to hint about what Lisp you use?

Re: Differences with other Lisps

#74
post #70

Earlier quoted context omitted.

> 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…

Neat, I don't remember hearing about the "command" justification before. I suppose this is a rationale behind e.g. the 'ns macro separating its command-keywords that map to functions with parens? Still, I always thought the full syntax of 'ns and the individual things inside of it was a bit wild. Thank goodness for Slamhound... Like, take (import [package thing-in-package other-thing-in-package]) -- the first element…

Oh yeah, you're right, multi-arity fns are also a big exception to the empirical "rule" I mentioned. And yes, (ns) macro looks like a historical mess indeed.

> but I am saying that I don't think Clojure's introduction of [] and {} for core syntax on top of their roles as data literals actually made things any better

I think of it as embedded JSON so that it's easier to type data structures, and with Clojure you end up with _a lot_ of data structures to type, since Clojure strongly encourages data-oriented programming.

Disclaimer: though, Clojure is my first and only lisp I've used professionally, so I am for sure missing (by not knowing better) many goodnesses that Common Lisp brings to the table.

Re: Differences with other Lisps

#76
post #68
post #58

Earlier quoted context omitted.

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

Is this surprising? I don't see an ecosystem of languages targeting the Go runtime, in contrast to the JVM, Javascript, Erlang, MS CLR... I don't think this is necessarily a matter of popularity or maturity. I don't know of languages that compile to Python bytecode, either. In Python's case I suspect the VM is so optimized for Python that it makes an inflexible target for other languages: I don't know enough about th…

> Is this surprising? I don't see an ecosystem of languages targeting the Go runtime, in contrast to the JVM, Javascript, Erlang, MS CLR...

I think I'm surprised in general that no language targets the Go runtime. A ML built on Go could probably be popular, lots of people would like features from it.

Not exactly bytecode but Hy https://github.com/hylang/hy is a dialect of Lisp that compiles to Python.

Re: Differences with other Lisps

#77

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…

Previous lisps had only the list as a datastructure with a special syntax and the program was only represented as lists.

There are different "schools" now. Some argue that representing the program only with lists is more uniform and simple. Rich Hickey argues that the different multiple usages of lists in "traditional" lisps, such as in Common Lisp, imposes a cognitive burden so increase the complexity.

The Janet language for example follows Clojure whereas as Racket is still a modern language but follows the "tradition".

Re: Differences with other Lisps

#78
I've only just started learning Common Lisp and never used Clojure, but what are the implications or trade-offs of

>Symbols are not storage locations (see Var)

I thought the way symbols worked in CL are one of the three big ideas (s-exps and macros being the other two).

Re: Differences with other Lisps

#79
post #67

Earlier quoted context omitted.

The commercial Common Lisp I use, also has large amounts of extensions to CL. Including a function to split sequences/strings, parallel and concurrent extensions, ... ;-) It's actually the same commercial Common Lisp which Rich Hickey used years ago to write his first Lisp programs and where he developed his first ideas for Clojure.

Are you working under an NDA or something? Are you being threatened? Blink three times if you need help. Seriously, is there a reason you have to hint about what Lisp you use?

There are about two of them anyway.

Re: Differences with other Lisps

#80

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…

I've read that Clojure(Script) has a great REPL experience. Even when using VSCode, can one use the REPL easily?

Yes, you can. It's all pretty seamless with Calva & VS Code.
Post reply on HN