News for hackers. Stuff that matters.
Re:TimL: Clojure-like Lisp dialect that runs on and compiles... by ReleaseCandidat on Saturday May 27, 2023 @08:39AM (#36094258)
There are things I'll never understand. Why would anybody do this? Why Clojure and not Emacs Lisp?
Re:TimL: Clojure-like Lisp dialect that runs on and compiles... by jacknews on Saturday May 27, 2023 @08:43AM (#36094299)
"There are things I'll never understand."

=> true

Re:TimL: Clojure-like Lisp dialect that runs on and compiles... by ReleaseCandidat on Saturday May 27, 2023 @09:06AM (#36094486)
Hmm, that's

    > "There are things I'll never understand."
    "There are things I'll never understand."
for me. But

    > (cond ("There are things I'll never understand." 'true))
    true
works.

Seriously I'm glad to not understand everything, that would be quite worrying and/or boring.

Re:TimL: Clojure-like Lisp dialect that runs on and compiles... by capableweb on Saturday May 27, 2023 @08:50AM (#36094371)
Clojure is a language created and "controlled" by a single author (pretty unified overall) as a general purpose language, with implementations for multiple languages.

Emacs Lisp (elisp) is a language specifically created as a scripting language for an editor, maintained by an organization, with one compiler (AFAIK) and 99% of usage is within Emacs.

It's not hard to imagine people preferring Clojure before elisp, especially outside of Emacs.

Re:TimL: Clojure-like Lisp dialect that runs on and compiles... by ReleaseCandidat on Saturday May 27, 2023 @08:58AM (#36094438)
To be honest, I would prefer Clojure to Elisp too.

But to be frank, it's hard for me to imagine people preferring Vim over anything that isn't ed ;). Although, at least using ed you don't need to type the colons :)

Re:TimL: Clojure-like Lisp dialect that runs on and compiles... by rollcat on Saturday May 27, 2023 @09:04AM (#36094474)
That would be awesome. Next step: run evil-mode on top of it.

We've come full circle.

Re:TimL: Clojure-like Lisp dialect that runs on and compiles... by emmanueloga_ on Saturday May 27, 2023 @10:33AM (#36095137)
because the author wants it?
Re:TimL: Clojure-like Lisp dialect that runs on and compiles... by roenxi on Saturday May 27, 2023 @12:02PM (#36095796)
Emacs lisp is a terrible lisp dialect. If it wasn't for Emacs' popularity it would have died decades ago. This is just one example in a long line of examples where nobody willingly implements Emacs lisp. Even in Emacs there is pressure to move towards Common Lisp.

Emacs lisp has, as far as I can tell, no advantages. It isn't especially good at text editing. It introduces differences from more popular lisp dialects. Anything it offers could be a library in some other lisp.

Clojure on the other hand, has a couple of nice syntax innovations and smooth default data structures.

Re:TimL: Clojure-like Lisp dialect that runs on and compiles... by tmtvl on Saturday May 27, 2023 @06:13PM (#36098911)
Some people like Clojure syntax rather than S-expressions. Personally I don't get it, having arbitrary lists that require square instead of round brackets, arbitrary lists where pairs which belong together aren't grouped, and arbitrary lists where commas are interpreted as optional whitespace gives me a headache; but to each his own.
Re:TimL: Clojure-like Lisp dialect that runs on and compiles... by jakebasile on Saturday May 27, 2023 @08:01PM (#36099716)
Clojure still uses S expressions, it just has more than just lists available. Square brackets don't make lists, they make vectors. Commas are always optional. I don't know what you mean by "arbitrary lists where pairs which belong together aren't grouped", but maybe you mean maps or sets, which are also not lists but a different data type.

  user=> (type [])
  clojure.lang.PersistentVector
  user=> (type '()) ; gotta quote the list
  clojure.lang.PersistentList$EmptyList
  user=> (type {})
  clojure.lang.PersistentArrayMap
  user=> (type #{})
  clojure.lang.PersistentHashSet

Different data types are used for different things. Vectors have more natural insertion behavior, so most people use them where that might happen.

  user=> (conj '(1) 2)
  (2 1)
  user=> (conj [1] 2)
  [1 2]
Re:TimL: Clojure-like Lisp dialect that runs on and compiles... by tmtvl on Monday May 29, 2023 @05:54AM (#36112377)
The example that most typifies my issues with Clojure syntax is let-binding. In Lisp it's very clearly structured:

  (let ((foo bar)
        baz
        (quux frob))
    ...)
In Clojure not only are the bindings unstructured, they are thrown into a vector. Not a list, not a map (for which Clojure has dedicated syntax, mind), a vector.

  (let [foo bar baz quux frob]
    ...)
And that is one of the only two places I know of where Clojure arbitrarily uses a vector when it uses lists everywhere else:

  (defn foo [bar] ...)
Instead of either of:

  (defn foo (bar) ...)
  [defn foo [bar] ...]