| ▲ | panstromek 13 hours ago | ||||||||||||||||
I think agree (but I think I think about this maybe a one level higher). I wrote about this a while ago in https://yoyo-code.com/programming-breakthroughs-we-need/#edi... . One interesting thing I got in replies is Unison language (content adressed functions, function is defined by AST). Also, I recommend checking Dion language demo (experimental project which stores program as AST). In general I think there's a missing piece between text and storage. Structural editing is likely a dead end, writing text seems superior, but storage format as text is just fundamentally problematic. I think we need a good bridge that allows editing via text, but storage like structured database (I'd go as far as say relational database, maybe). This would unlock a lot of IDE-like features for simple programmatic usage, or manipulating langauge semantics in some interesting ways, but challenge is of course how to keep the mapping between textual input in shape. | |||||||||||||||||
| ▲ | thesz an hour ago | parent | next [-] | ||||||||||||||||
Michael Franz [1] invented slim binaries [2] for the Oberon System. Slim binaries were program (or module) ASTs compressed with the some kind of LZ-family algorithm. At the time they were much more smaller than Java's JAR files, despite JAR being a ZIP archive.[1] https://en.wikipedia.org/wiki/Michael_Franz#Research [2] https://en.wikipedia.org/wiki/Oberon_(operating_system)#Plug... I believe that this storage format is still in use in Oberon circles. Yes, I am that old, I even correctly remembered Franz's last name. I thought then he was and still think he is a genius. ;) | |||||||||||||||||
| ▲ | zokier 2 hours ago | parent | prev | next [-] | ||||||||||||||||
> but storage format as text is just fundamentally problematic. Why? The ast needs to be stored as bytes on disk anyways, what is problematic in having having those bytes be human-readable text? | |||||||||||||||||
| ▲ | fuhsnn 12 hours ago | parent | prev | next [-] | ||||||||||||||||
Structural diff tools like difftastic[1] is a good middle ground and still underexplored IMO. | |||||||||||||||||
| |||||||||||||||||
| ▲ | flowerbreeze 10 hours ago | parent | prev | next [-] | ||||||||||||||||
I'm quite sure I've read your article before and I've thought about this one a lot. Not so much from GIT perspective, but about textual representation still being the "golden source" for what the program is when interpreted or compiled. Of course text is so universal and allows for so many ways of editing that it's hard to give up. On the other hand, while text is great for input, it comes with overhead and core issues for (most are already in the article, but I'm writing them down anyway):
I think input as text is a must-have to start with no matter what, but what if the parsing step was performed immediately on stop symbols rather than later and merged with the program graph immediately rather than during a separate build step?Or what if it was like "staging" step? Eg, write a separate function that gets parsed into program model immediately, then try executing it and then merge to main program graph later that can perform all necessary checks to ensure the main program graph remains valid? I think it'd be more difficult to learn, but I think having these operations and a program graph as a database, would give so much when it comes to editing, verifying and maintaining more complex programs. | |||||||||||||||||
| ▲ | zelphirkalt 12 hours ago | parent | prev | next [-] | ||||||||||||||||
Why would structural editing be a dead end? It has nothing to do with storage format. At least the meaning of the term I am familiar with, is about how you navigate and manipulate semantic units of code, instead of manipulating characters of the code, for example pressing some shortcut keys to invert nesting of AST nodes, or wrap an expression inside another, or change the order of expressions, all at the pressing of a button or key combo. I think you might be referring to something else or a different definition of the term. | |||||||||||||||||
| |||||||||||||||||
| ▲ | conartist6 13 hours ago | parent | prev [-] | ||||||||||||||||
Come the BABLR side. We have cookies! In all seriousness this is being done. By me. I would say structural editing is not a dead end, because as you mention projects like Unison and Smalltalk show us that storing structures is compatible with having syntax. The real problem is that we need a common way of storing parse tree structures so that we can build a semantic editor that works on the syntax of many programming languages | |||||||||||||||||
| |||||||||||||||||