2 ms·
What I would like to see is a way to separate the the syntax of my code from the semantics of my code. Ideally, my code editor should be able to take the same p
by ohyes 16y ago
What I would like to see is a way to separate the the syntax of my code from the semantics of my code. Ideally, my code editor should be able to take the same piece of code and display it in a few different styles of syntax.
Then I could write my code in whatever syntax I want, and someone else could flip a switch and change it into their preferred style of syntax.
I am honestly kind of puzzled as to why the concept of MVC disappears as soon as we start writing coding tools. It seems that for any reasonable syntax that you can write a parser for; it should also be possible to write an emitter from an 'intermediate' syntax tree.
- asharp 16y agoFrom what I remember, the problem isn't producing something that parses (for the emitter), the problem is producing something that could still be considered human readable and/or not horribly ugly.
- wladimir 16y agoI've also thought about this a few times. It's a pity that the SCID (Source Code in Database) paradigm never really caught on. It would make things such as representing the same code with different syntax (depending on user preference) possible. It also makes refactoring/renaming easy as names are only stored in one place, the rest refers to the same 'entity'. And you're right, best practices for data formats are applied everywhere except for code. After all, we're now in 2011 and still using old-fashioned text files.