4 ms·
This is a weak argument. Practically all languages compound symbols made from multiple characters, such as >=; there is no shortage of symbols. Also, nearl
by taeric 9y ago
This is a weak argument. Practically all languages
compound symbols made from multiple characters, such as
>=; there is no shortage of symbols. Also, nearly all
programming languages have a function-call notation, but
only Lisp-based languages choose s-expressions to notate
it, so saying “we need function call notation” do not
excuse s-expressions.
I'm ironically going to complain that this is a weak rebuttal.
For one thing, I find it hilarious to see how well this predicted the explosion of silly operators in some of the current languages. (Haskel and Scala, I'm looking in your general directions...)
Second, the point is that all function calls now look the same. Both in serialized form and in parsed form. That is, the homoiconic nature is the point, no? To treat that as a somewhat byproduct is somewhat odd.
They then go on to posit the use of meaningful whitespace. Something that is quite disgusting to me. It is dreadfully easy to mistakenly read whitespace. To the point that I do think programs are textual art, and care should be used to structure them in a pleasant and easy to read way. However, I cannot bring myself to like meaningful whitespace. YAML has given me enough headaches in life in a scant year, that I am pretty firmly on the opposite side of that fence now.
- dwheeler 9y ago> They then go on to posit the use of meaningful whitespace. Something that is quite disgusting to me. Clearly not everyone agrees with this viewpoint, since Python depends on it and is extremely popular. But if you don't want meaningful whitespace, that's fine. We actually devised three notations, each one a superset of the previous ones: * curly-infix-expressions (c-expressions) * Neoteric-expressions (n-expressions) * Sweet-expressions (t-expressions) Only the last one (sweet-expressions) is whitespace-sensitive. More info here: https://readable.sourceforge.io/ https://readable.sourceforge.io/
- RoboTeddy 9y agoThis looks really nice! Are there any largish examples written with sweet-expressions? (Seeing large chunks of code could help with forming a gestalt impression)' Edit: found one - https://sourceforge.net/p/readable/code/ci/master/tree/src/sweeten.sscm https://sourceforge.net/p/readable/code/ci/master/tree/src/s...
- taeric 9y agoI'd be surprised if python is winning folks over because of the significant whitespace. More that it just is not a deciding factor. (Note, I'm specifically not saying it is popular despite the whitespace.) That is to say, yes, I recognize my opinion as just an opinion. Most of it is colored by bad experiences with large YAML files, I confess. My problem with the code is precisely that it tears down my notion of the code being nothing more than a list of data. As an example, in: (define (factorial n) (if (<= n 1) 1 (* n (factorial (- n 1))))) Everything that goes together is in the same list. Some things branch off of because they are part of another list. But all subexpressions are easily visible as just lists. I can take one out and try it somewhere else. How do I know they are lists? Because they look like every other list in the program. Begin and end with a paren. The "improved one": define factorial(n) if {n <= 1} 1 {n * factorial{n - 1}} How do I know it is over? How do I trace back to what part of the code is finished when I evaluated {n * factorial{n - 1}}? Hopefully, the code is short enough that these are obviously answered. However, I am well aware that sometimes this doesn't work. And, quite frankly, the brain power to find the matched paren is much less than the brain power to determine what lexical unit the compiler would have been in, and to scan up for the matching lexical unit. Then there is the contrarian in me that is probably just getting annoyed that they labeled the proposal as the "improved" piece of code. :D
- pka 9y agoI agree in general that sexps provide the best editing experience currently, but that's just a matter of tooling, it's not an inherent property of sexps vs infix or whitespace-dependent syntax. Check out [0], a structured editing mode for Haskell, a whitespace-sensitive language. Incidentally, while I have no problem with Lisps (I've used Clojure for about a year), I do prefer infix notation, precisely because it's not homogeneous. [0] https://github.com/chrisdone/structured-haskell-mode https://github.com/chrisdone/structured-haskell-mode
- taeric 9y agoYou likely prefer infix because it is familiar. It is amazing how much familiarity influences preference. And yes, tooling can help. For either case. I'm leaning towards simpler tooling, which means me towards s-exps. Mainly because a lot of time has passed, and evidence is structured editing just doesn't take off in other languages. And I don't see requiring tooling as an improvement.
- crdoconnor 9y ago>However, I cannot bring myself to like meaningful whitespace. YAML has given me enough headaches in life in a scant year, that I am pretty firmly on the opposite side of that fence now. The only time YAML gives me a headache with respect to whitespace is when I'm using block literals which have trailing whitespace. I don't think any other serialization format really deals with that problem well though - either you have a long, nicely readable block of text that looks ambiguous with trailing whitespace or you have a nasty escaped "long string with \n\n \n\'s" everywhere. Block literals: | are a killer feature, too. They are so damn useful when you have strings spanning multiple lines. Meaningful whitespace means that syntactic clutter can be removed. That makes the markup much more readable because there's less distracting syntactic noise. YAML diffs are very readable, for instance, but JSON diffs (as well as diffs for every other kind of serialization format without meaningful whitespace), are very much not.
- taeric 9y agoI can't remember the parts that pained me most. Some were in somewhat odd sounding "lists of single items" versus "list of single dict items" and such. In particular, the vast difference between: baz: bat: - foo: bar and baz: bat: - foo: bar is not at all obvious at a glance to me. If I convinced everyone to move to 4 or 8 character indents, it would stick out a little more, but I don't see myself winning that fight. Worst of all, this mistake happened when I was moving some template from one place to another in a different file. Should be easy. Copy, paste, fix whitespace. The problem is that "fix whitespace" has to know about the copy/paste. You can't just reformat after the fact. Yes, tooling could "paste with indentation for current cursor" but you literally cannot "paste, then fix whitespace." It is like the worst of outlooks "paste with formatting".
- crdoconnor 9y agoI actually wrote a YAML parser that closed this loophole by raising an exception on YAML files that have inconsistent indents. Somebody reported exactly that as an issue on my issue tracker: https://github.com/crdoconnor/strictyaml/issues/23 https://github.com/crdoconnor/strictyaml/issues/23 I'm aware that there are a bunch of annoyances like that, but I'm still convinced the core is good and making a new standard which is stricter solves most of these issues. FWIW, I haven't run into this problem personally but it's pretty obvious that it is a problem.