Search code examples
clojurelispjulialanguage-designdylan

What would Clojure lose by switching away from leading parenthesis like Dylan, Julia and Seph?


Three lispy homoiconic languages, Dylan, Julia and Seph all moved away from leading parenthesis - so a hypothetical function call in Common Lisp that would look like:

(print hello world)

Would look like the following hypothetical function call

print(hello world)

in the three languages mentioned above.

Were Clojure to go down this path - what would it have to sacrifice to get there?

Reasoning: Apart from the amazing lazy functional data structures in Clojure, and the improved syntax for maps and seqs, the language support for concurrency, the JVM platform, the tooling and the awesome community - the distinctive thing about it being 'a LISP' is leading parenthesis giving homoiconicity which gives macros providing syntax abstraction.

But if you don't need leading parentheses - why have them? The only arguments I can think of for keeping them are

(1) reusing tool support in emacs

(2) prompting people to 'think in LISP' and not try and treat it as another procedural language)


Solution

  • Writing macros would become much more difficult because the structure would no longer be simple you would need another way to encode where expressions start and stop using some syntactic symbol to mark the start and end of expressions to you can write code that generates expressions perhaps you could solve this problem by adding something like a ( to mark the start of the expression...

    On a completely different angle, it is well worth watching this video on the difference between familiar and easy making lisps syntax more familiar wont make it any easier for people to learn and may make it misleading if it looks to much like something it is not.

    even If you completely disagree, that video is well worth the hour.