7 ms·
Absence of syntax! I really wish every language were a lisp. Like, Rust, the lisp, Swift, the lisp. Who needs rules of precedence and associativity and state
by paultopia 7y ago
Absence of syntax! I really wish every language were a lisp. Like, Rust, the lisp, Swift, the lisp. Who needs rules of precedence and associativity and statements vs expressions and all the other stuff that languages that aren't lisps impose on you? Just stick an expression in some parentheses! And then put that in another expression!
- mschaef 7y agoAbsence? There's absolutely syntax in Clojure. 1) Lexemes have a specific structure. 2) Core data types have a specific syntax (representable with a grammar). 3) The data types used to represent programming constructs also have a specific set of syntactic rules by which they are assembled. It's a different kind of syntax than the usual - more raw/direct, perhaps - but it's a misconception to say there is an absence of syntax. A big part of the reason I mention this is that the nature of Lisp's syntax is one of its biggest strengths.
- paultopia 7y agoFair enough. I was aiming for a non-technical use of the term "syntax" more or less tracking the cognitive burden of remembering and parsing out the relationship between symbols for the programmer. Like, putting s-expressions in the front seat feels like a much lower cognitive load to me than, for example, all the stuff you have to think about writing, or, god help you, reading, pointfree haskell or line noise perl
- deleted 7y ago[deleted]
- LandR 7y agoYes, there is syntax, but there is a lot less noise and syntactic bureaucracy compared to other languges.
- sevensor 7y agoYes please. Like the sibling comment says, it's definitely a syntax, but what a lovely syntax it is! Like a master key unlocking program structure. When I'm studying other functional languages, I find that the best way to make sense of their syntax is to figure out where the parentheses should go.
- lmm 7y ago(find (most people) difficult (without (infix operations) (to expressions write)))
- maehwasu 7y agoThere’s definitely a learning curve, but it’s not a terribly steep one, and most minds with programming aptitude don’t seem to have much trouble with it after that. It’s similar to learning declensions in Russian/German/Latin: weird and seemingly pointless to English speakers, and then usually fully internalized after a few months, with better intuition for costs and benefits of syntax vs cases. I’d argue that the Clojure learning curve is significantly shorter than that also. The best criticisms of Clojure (and I’ve written a lot in it) have nothing to do with parentheses, but rather the difficulties of grokking other people’s dynamic, untyped code.
- ken 7y agoWorse than untyped code is undocumented code. Some programmers think types obviate the need for docs. Some programmers think concision obviates the need for docs. Except in the most trivial cases, they're both wrong.
- paultopia 7y agoMy gripe with other people's code in Clojure is less understandability in terms of types and more in terms of style. A lot of major clojure libraries seem to use a really indirect style that brings a bunch of OO-style concepts back in. Like, I'm thinking of libraries like Component and Mount whose authors seem to have been aiming for a dependency injection kind of experience and end up creating a bunch of free-floating state, where, for example, you use a template to scaffold a simple webapp up, and it's surprisingly hard to figure out where in the code it's talking to the database. This actually caused me to leave the clojure ecosystem eventually.
- lincpa 7y agoIf you use "The Pure Function Pipeline Data Flow",it only need Unix-style pipes and functions. you won't have to use concepts or patterns of OO&FP, and the parentheses are less than any programming language ;) [The Pure Function Pipeline Data Flow](https://github.com/linpengcheng/PurefunctionPipelineDataflow https://github.com/linpengcheng/PurefunctionPipelineDataflow)
- jcora 7y agoThis sounds horrifying.
- yogthos 7y agoSame here, after working with s-expressions I realized that you don't need to drown in syntax to have a flexible and expressive language. Complex syntax introduces a ton of mental overhead, and it's a constant source of weird and hard to debug errors because code often does something subtly different from what you think it's doing. S-expressions enforcing a consistent and explicit syntax frees up a ton of mental space for me.
- bgorman 7y agoAmen. S-expressions allow you to navigate the code through your editor, and everything is consistent. Semicolons, commas, and curly braces are major cognitive overhead.
- _emacsomancer_ 7y agoOr, rather, a single simple syntax that applies throughout the language.