6 ms·
I think S-expressions are fundamentally too difficult to work with, without good editor support, to make Lisp anything other than a niche power tool for the hig
by nerdponx 4y ago
I think S-expressions are fundamentally too difficult to work with, without good editor support, to make Lisp anything other than a niche power tool for the highly motivated. I love CL, Scheme, Clojure, Janet, Fennel, etc. but I don't blame anyone for finding them inaccessible.
I think Python, JavaScript, and Go have caught on for somewhat similar reasons, compared to Java and C#: they are easier to get started with, and you can still scale them up to fairly large applications.
On the other hand, I think S-expressions are a sadly underexplored format for data serialization and storage.
- wrycoder 4y agoBut, you always have good editor support. Lisp/Scheme has traditionally been coded using Emacs or its equivalent. With that support, the parens seem to disappear after you've been writing lisp for awhile. Beginner lispy languages come with a suitable beginner IDE, e.g. Racket or Logo. A typical lisp statement has a leading '(' and a trailing ')', which replaces the ';' in Algol-like languages. So, one additional character, which brings a lot of benefit when writing DSLs and macros. (Python doesn't have the ';', but its whitespace is ambiguous, so that's not a fair comparison.) Sane people don't write lisp using Notepad.
- comfypotato 4y agoI think the parent comment is alluding to the notion that the very entry level programmer enjoys being able to use notepad. That is to say the initial barrier of eMacs is just too much. Obviously worth it in the long run though.
- db48x 4y ago“eMacs” is the wrong capitalization. It’s “Emacs”.
- comfypotato 4y agoM-c would fix that I believe. My autocorrect has been doing that for some reason and I assumed there was logic to it. Your comment sent me on a dive that proved my intuition woefully incorrect.
- bambataa 4y agoI tried using Slime with Scheme when I was doing SICP. I’m sure it’s great when you know it well, but I kept pressing the wrong shortcut and moving things around in ways I didn’t intend and then it wouldn’t let me manually type or delete parentheses to fix things. I found it very frustrating and ended up turning it off. Just another barrier and C-style languages seem much easier to write in comparison.
- Jtsummers 4y agoSlime did that? Slime doesn't take over the editor that much (it shouldn't prevent you from typing parentheses, I've used it for 16 years or so and never experienced anything like that). Was it paredit or another editor mode?
- bambataa 4y agoSorry you’re right, it would have been Paredit. I guess my point is that syntax that works very well with a correctly configured editor used by someone who knows what they’re doing is going to have a higher barrier to entry than a language that can be easily edited in Notepad.
- Jtsummers 4y agoLisp is no harder to edit in notepad than any other language. It is just a text editor and lisp source is just text. And paredit is a misfeature for most people, turn it off. That should have been the real takeaway. It is not part of a ”correctly configured editor” and it isn’t installed or activated by default anyways so is easy to avoid.
- wrycoder 4y agoYeah, all you have to do is keep track of the number of closing parens in your head. It’s a lot easier when the editor highlights matching pairs.
- deleted 4y ago
- deleted 4y ago[deleted]
- bmitc 4y agoI have never really understood people‘s aversion to parentheses. Many languages require them in ad-hoc ways to groups expressions. For S-expressions, you give up some mild convenience and looks for extremely consistent semantics.
- krapp 4y agoIt's not so much an aversion to parentheses as an aversion to nothing but parentheses. Other languages use other brackets to indicate different contexts, but s-expressions can more difficult to read. The idiom of putting all of your end parens on a single line doesn't help. And for most people, the mild convenience of readability is preferable to the consistent semantics.
- kazinator 4y ago> The idiom of putting all of your end parens on a single line doesn't help. Yes it does; doing it any other way is strictly worse regardless of where you stand on parentheses as such.
- pfdietz 4y agoI don't think the syntax has anything to do with the outcome. Some people like to complain about it, but it's just meaningless noise.
- Oreb 4y agoWhat’s the problem with having the end parens on a single line? I never understood why languages with curly brace syntax don’t do the same. A line of code containing nothing but a curly brace seems like a waste of screen real estate to me. It contains absolutely no information (the end of the block can be seen by indentation anyway).
- wrp 4y agoLisp syntax is an extreme impediment to uptake. Consider what happened to Lisp-Stat. It was a really slick package, but people immediately dropped it when R became available. Lisp defenders like to think that R won out because of better libraries, performance, or some such. The truth is that the stampede began while R was still in a rough state, people were so eager to get away from Lisp.
- lispm 4y agoIronically R inside is still much of a Lisp. > The truth is that the stampede began while R was still in a rough state, people were so eager to get away from Lisp. That's not a big surprise. The syntax is/was an important reason. Most users of statistics / maths software prefer a more math-like notation. Even the bigger Lisp applications in the maths area provide that always: Macsyma/Maxima, Reduce, Axiom, Derive, .. One could have written that on top of Lisp, but it was much more convenient to develop a specialized language/runtime using C. C + Lisp + R would have been more complex than C + R.
- gnufx 4y agoIs it clear people wanted to get away from Lisp rather than use a more-or-less clone of S? (One of R's originators did propose moving back to a Lisp base [1], though part of the justification was HPC, which is now at least partially covered [2].) However, much as I like Lisp, I do want a mixfix syntax for interactive use like R, but something CGOL-ish is easy enough; I don't remember xlisp-stat having something like that. 1. https://www.stat.auckland.ac.nz/~ihaka/downloads/Compstat-2008.pdf https://www.stat.auckland.ac.nz/~ihaka/downloads/Compstat-20... 2. https://pbdr.org https://pbdr.org
- wrp 4y ago> Is it clear people wanted to get away from Lisp rather than use a more-or-less clone of S? That's a good point. How many statisticians were familiar with S but were using Lisp-Stat just because it was free? I don't seem to have traveled in those circles. I wasn't paying a lot of attention, but I don't remember encountering that on campus. Another slick Lisp package that got too little attention was Yann LeCun's Lush.
- ivan4th 4y agoI find this syntax argument a bit strange nowadays. There's this extremely popular Kubernetes tool called Helm, which uses go-templated YAML to generate Kubernetes resources. The template syntax is nothing short of horrible. An endless maze of {{ ... }}s, where it's just too easy to shoot oneself in the foot by using {{- or -}} in wrong place, etc. And on top of that, you literally need to count spaces for nindent (mind you, you don't need to count parentheses while writing Lisp code). I'd say Lisp syntax is clear as day when compared to your average Helm template. An example is here: https://github.com/kubernetes/ingress-nginx/blob/main/charts/ingress-nginx/templates/controller-daemonset.yaml https://github.com/kubernetes/ingress-nginx/blob/main/charts... https://github.com/kubernetes/ingress-nginx/blob/main/charts/ingress-nginx/templates/_helpers.tpl https://github.com/kubernetes/ingress-nginx/blob/main/charts... And yet, all of this somehow doesn't prevent Helm from being popular...
- lispm 4y agowow, how could that happen?
- kazinator 4y agoI've done all my Lisp coding, pretty much ever, in Vim. Just basic :set lisp mode, % key for matching parens, autoindent and off we go. I didn't see any difference between that and C editing support.