4 ms·
This doesn't really resonate with people though, as most people are more familiar with C-style notation. Also: >Writing code like this is combersome and unnece
by NewsaHackO 2y ago
This doesn't really resonate with people though, as most people are more familiar with C-style notation. Also:
>Writing code like this is combersome and unnecessarily symbol heavy
Does not make sense in this context, as it mainly applies to Lisp-like languages that uses parentheses heavily.
- n4ture 2y agoYeah was going to change that part too for something like "Writing code like this is verbose and spans too many lines", but then I just thought it'd be better if it sounded more like the parent comment. And I understand it doesn't resonate with most, I just wanted to highlight how the initial parent comment was very subjective and not very substantive, some people didn't take the joke so well, I guess it could've sounded a bit passive aggressive. I personally enjoy both C-like and Lisp-like syntaxes and languages, I do have a sweet spot for Forth tho. But back on topic, Fennel is a great language, working with Love and Fennel is really nice. And if the parentheses can seem off-putting for some, I'd highly encourage to give it a shot as you can quickly get past it and see how comfy it feels to have your statements properly demarkated. S-expr shine the most when working with XML-like structure. Spinneret[1] was the most fun I ever had working with HTML, every other templating engine feels subpar now that I have tasted that sweet nectar.. [1] https://github.com/ruricolist/spinneret https://github.com/ruricolist/spinneret
- pertymcpert 2y agoIt's your comment that seems to add the least, because the majority agree with the OP. The point is that ergonomics is not as good, of course there are contrary opinions. The existence of a contrary and minority opinion doesn't detract from the point.
- fuzztester 2y ago>Does not make sense in this context, as it mainly applies to Lisp-like languages that uses parentheses heavily. I had read, some years back, that someone did an actual calculation / demonstration that showed that the number of symbol / punctuation characters in Lisp is actually less than in C-based languages, for a block of code with equal functionality in both languages. I don't have the reference handy. Someone here may know of it, and post it.
- Zambyte 2y agoIt's obvious to anyone who is familiar with both. (f x y) vs f(x, y); Note the extra comma and semicolon. The only place this breaks down is for simple arithmetic expressions like (+ a b) vs a + b, which is trivial enough to ignore (and also goes back in favor of Lisp when you start having more operands).
- packetlost 2y agoAs someone who likes lisps, visual separation is helpful. I tend to find complicated Lisp code just blends together into syntax soup
- bmacho 2y agoIt is only function calling that needs (,); in C and () in Lisp. Which is half as many characters, but much much much noisy since: - it is used everywhere - carries very little information Look at the example on the Janet page transcribed to Python syntax [0]. Several differences: - in Janet nearly every line starts and ends with ( and ), which is just noise - in Janet there are several )))) - in Janet there is no special syntax for: function definition, variable definition, collections, statements - while Python is the opposite, it reads like a mix of English and Mathematics. Also it has special syntax for the ~5 things that you can do with the language, so you can just look at the Python code from far, don't read it, and you'll have a clue what's going on. It is also helpful when you search for something with your eyes. Also nested parentheses are different shaped parentheses, so you know which ones match. Also in theory you could manipulate Python AST the same way you do in Lisps both in your editor and both at program-level. In practice you can't do that. [0] : https://news.ycombinator.com/item?id=34846516 https://news.ycombinator.com/item?id=34846516
- Zambyte 2y agoOk, let's compare looping for (int i = 0; i < 5; i++) { printf("%d\n", i); } vs (loop for i from 0 below 5 do (format t "~A~%" i)) C has the same number of parentheses and also has curly brackets. C additionally has a bunch of semicolons and a comma not present in the Lisp version. The C version is also omitting the required function encapsulation to actually run this, while the Lisp version can be run as a top level expression. The comparison really isn't even close. If you really want, you can always put the trailing )) on new lines like people do with the trailing }}}} for their nested if in a for in a method in a class in C-like languages. The Lisp community has just decided that putting single characters on new lines like that is needlessly noisy and emphasizes characters that are easily ignored by humans and instead manipulated using structural editing.
- smnplk 2y ago>> as it mainly applies to Lisp-like languages that uses parentheses heavily. This is so wrong. Lisp does not use parentheses heavily. It doesent even use more parens than any C like language. I just dont understand the fixation with parentheses. The power of lisps comes from the fact that everything is an expression. Someone can correct me if I am wrong, since I only have experience with functional lisp Clojure, but I believe other lisps are more or less similar. So if everything can be evaluated, then you can have a really great REPL experience. You can be inside your favorite editor and have the tightest feedback loop possible. So the absence of statements is actually a great feature of the language which improves ergonomics.
- zelphirkalt 2y agoThe anti parentheses argument is usually just a straw that people grasp, who have no experience with writing code in lispy languages. A quick superficial jab at something they do not know well, so that they can go on with their day, without having to deal with learning a new thing, that might change their whole view of programming.
- MonkeyClub 2y agoPlus, don't forget the secret sauce of Lisp syntax: same number of parentheses, with none of the commas. Nor the semicolons. Nor the brackets. Nor the braces.
- smnplk 2y agoI can live with brackets and braces tho ;) Clojure <3 But that is a very nice observation that is true for traditional lisps. I need to give racket or scheme one more look.
- eager_learner 2y ago[dead]
- GoblinSlayer 2y agoI just don't understand the fixation with REPL. How do you use it? It sounds like you write code as black box then run it in REPL to see what it does because you don't understand it by yourself.
- eager_learner 2y ago[dead]