3 ms·
> you work directly with an AST and the UI only permits modifications by operations that preserve the correctness of the AST. It eliminates all sources of bugs
by Jwarder 7y ago
> you work directly with an AST and the UI only permits modifications by operations that preserve the correctness of the AST. It eliminates all sources of bugs
With the caveat up front that I know nothing about this beyond what you have written: wouldn't this just catch compilation bugs? The compiler tells me if the blob of text I gave it is incorrect in terms of any syntax errors.
Business logic bugs and accounting for bogus data seem more important to me.
- carapace 7y agoYes, you and skybrian have got the idea. It wasn't magic, it just prevented entire categories of preventable bugs, syntax and semantics. You could still use it to write correct programs that did the wrong thing. In other words, it couldn't catch bugs that occur "between the keyboard and the chair". FWIW the tech has a bit of a Wikipedia page now: https://en.wikipedia.org/wiki/Universal_Systems_Language https://en.wikipedia.org/wiki/Universal_Systems_Language but it doesn't seem very informative to me. YMMV
- eitland 7y agoOk, so you admit this was wild hyperbole: > It eliminates all sources of bugs,
- carapace 7y agoHyperbole, yes, wild, no. My problem is I've been trying to get traction on this for years and no one is interested. (Although type-checking is finally getting some love. It's not all doom and gloom out there.) Most bugs could be prevented or eliminated automatically.† If we're not doing that then in what sense are we entitled to call ourselves "engineers"? (Just to bring it back around to the topic.) I mean, our bridges collapse all the time. This is not science? †See Alice Pascal https://www.templetons.com/brad/alice.html https://www.templetons.com/brad/alice.html > In a syntax directed editor, you edit a program, not a piece of text. The editor works directly on the program as a tree -- matching the syntax trees by which the language is structured. The units you work with are not lines and chracters (sic) but terms, expressions, statements and blocks. This is still just syntactic correctness, you can only enter syntactically-correct Pascal programs, no typos either, but I don't think it did type-checking or anything like that. But it illustrates my point that if you're typing text into an editor and hoping it correctly describes a computer program, you're doing it wrong.
- goto11 7y agoYou might have a good case, but the way you present it makes it seem very disconnected from real-world development. Equating the most trivial kind of errors (which are caught by the compiler anyway) with "all sources of bugs" ignores the kind of bugs which are actually hard to prevent and might slip into production. But these are the kind of bugs developers are actually concerned about. Preventing editors from saving a file with a typo in it is a solution to a non-problem. If you want to interest people in these ideas, you should show how it can solve real problems.
- goto11 7y agoWhat do you mean with "semantics" in the first sentence?
- carapace 7y agoThe usual: https://en.wikipedia.org/wiki/Formal_semantics_of_programming_languages https://en.wikipedia.org/wiki/Formal_semantics_of_programmin... Consider: 1 + "two" That's syntactically valid in Python and JS but semantically valid only in JS, not Python: >>> 1 + "two" Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for +: 'int' and 'str' >> 1 + "two" "1two" Python raises a TypeError not a SyntaxError; JS Frankensteins the values together.
- goto11 7y agoSo how does this prevent any bugs which aren't already prevented by the language?
- Jwarder 7y agoI can imagine this being useful for people new to programming. I've seen plenty of times where students get overwhelmed with all of the different keywords/syntax they just learned and don't know where to apply it. Being able to give a list of possible actions available from the current node(?) could be a huge help.
- carapace 7y agoApparently they sat down, like, accountants in front of this thing and they could derive trees (programs) that automated tasks just fine with a bit of coaching. shrug (But that also worked with Lisp+Emacs! > programming new editing commands was so convenient that even the secretaries in his office started learning how to use it. They used a manual someone had written which showed how to extend Emacs, but didn't say it was a programming. So the secretaries, who believed they couldn't do programming, weren't scared off. They read the manual, discovered they could do useful things and they learned to program. https://www.gnu.org/gnu/rms-lisp.html https://www.gnu.org/gnu/rms-lisp.html )