3 ms·
>Maintaining tree on text editors requires careful editing and strict practices, which human brains aren't good at. The "tree" will get broken at some point, bu
by thrown_22 4y ago
>Maintaining tree on text editors requires careful editing and strict practices, which human brains aren't good at. The "tree" will get broken at some point, but, in this school of thought, the recovery strategy is unclear and inconsistent at best.
We've had editors that automatically do that since the 70s. Here's a live demo hot from 1986: https://youtu.be/-J_xL4IGhJA?t=2416 https://youtu.be/-J_xL4IGhJA?t=2416
>The real tree, at the end of the day, is formed by line breaks and indents, not parenthesis.
It isn't. You're not the type of person who lisp is for, which is fine. There are lots of languages suited for people like you.
But I'd be curious to know what language you think uses nothing but line breaks and indents to describe its AST.
- esjeon 4y ago> Here's a live demo hot from 1986: https://youtu.be/-J_xL4IGhJA?t=2416 https://youtu.be/-J_xL4IGhJA?t=2416 The process in the video still perfectly aligns with my description. Actually, I reached that conclusion by observing people writing Lisp code. That is, when you're writing Lisp code, that's exactly what people next you would see, no matter what you think. Also, trailing ")"s are clearly a burden, as people do spend their brain cycles to properly match them. > It isn't. You're not the type of person who lisp is for You sound like you're right in the middle of Lisp fever, which is fine. Everyone goes through that. > But I'd be curious to know what language you think uses nothing but line breaks and indents to describe its AST. You simply didn't get what I was saying. Even when all the parens were stripped off from a Lisp code, you can easily reinsert parens based on line breaks and indents. So people rely more on indentations for correctly putting parens, rather than being cautions w/ every single editing operation.
- thrown_22 4y ago>That is, when you're writing Lisp code, that's exactly what people next you would see, no matter what you think. People don't match them. The editor does. Computers are very good at this. Code editing isn't a spectator sport where you can judge how easy something is by watching someone else do it. Try par-edit-mode from emacs, it's a tree editor in a text editor. You'd have your mind blown from this piece of technology from the 90s that uses nothing but plain text to edit a tree using parens. >You simply didn't get what I was saying. Even when all the parens were stripped off from a Lisp code, you can easily reinsert parens based on line breaks and indents. So people rely more on indentations for correctly putting parens, rather than being cautions w/ every single editing operation. Really? So given f a b which of (f a b) (f (a b)) ((f a) b) did I strip the parens from?
- esjeon 4y agoI think I get picture here that you're probably taking my comment as some old-school Lisp-parenthesis-meme stuff. That's not it. I'm just freaking annoy by that we're using the same shit after decades. Nothing looks cool to me anymore. > People don't match them. The editor does. Computers are very good at this. Fixing parenthesis is a semi-automatic operation, performed by people aided by machine. People spend brain cycles on it, still in 2022. The tree-editing stuffs are in the same line. It's whole purpose is avoid dealing with parens and nested structures, but using it requires in-brain abstraction and getting used to a different set of operations. Extra costs to cognition and operation of the editor. Nothing difficult, but you have other dozens of "nothing difficult" to stack on top of it. Welcome to the world of complexity. > Try par-edit-mode from emacs ParEdit is an addition to text editor, and it doesn't block you from introducing mismatched parenthesis. It's actually an important feature, because an editor that forbids this will be more painful to use than manually fixing parens. So we still fix parens in 2022. Maybe I should compare this to ";" in C-like languages. There are editors, extensions, and formatters that can automatically insert semicolons, but, for whatever reason, semicolons go missing, so people fix it manually, still in 2022. Worse, in Javascript, missing semicolons often causes unintended behaviors, which makes it difficult to debug. Such a nice bug to have in 2022 on a language from 1990s. Holy Jesus, is this really what we should be dealing with until the last day in our lives? Including all the ancient craps that predates myself? I don't think so. > did I strip the parens from? Your example doesn't have any visual structure, and, in practice, we can just refer to the definition of `f` to solve that. Not an actual problem. What I was talking about is something like this: defun find-frame-class name cond and char= char name 0 #\T not member name '"TXX" "TXXX" :test #'string= ecase length name 3 'text-info-frame-v2.2 4 'text-info-frame-v2.3 string= name "COM" 'comment-frame-v2.2 string= name "COMM" 'comment-frame-v2.3 t ecase length name 3 'generic-frame-v2.2 4 'generic-frame-v2.3 (The original code is from https://gigamonkeys.com/book/practical-an-id3-parser.html https://gigamonkeys.com/book/practical-an-id3-parser.html ) The tree structure is visually represented in the indented code, which is far much easier for human brain to process. You almost immediately notice where parens should go. To recover parens without lines breaks, you should go over each symbol one by one, tracking their contexts. You know, state is evil. So the information embedded in code format is redundant to parens. IIRC, there were people who tried to abuse this to eliminate parens. Not really sure how that went.