3 ms·
This is like the idea of storing the code in a richer file format rather than just text. It would be up to the editor to format it and present it appropriately.
by daemin 11y ago
This is like the idea of storing the code in a richer file format rather than just text. It would be up to the editor to format it and present it appropriately. This would also allow for code comments, pre-post checks, assertions, and other metadata to be embedded into the code without having to be typed in some meta language or language extensions in the plain text.
I would like to experiment with something like that but given how much existing plain text code there is I don't see this happening any time soon.
- mchahn 11y ago> but given how much existing plain text code there is I don't see this happening any time soon. But this could work with existing code through simple translation. It could even possibly be converted to an outline when read into the outline-based editor and then be rewritten as plain text when saved. I have worked on a scheme that makes ES6 look like coffeescript when in the editor while stored as normal javascript on the disk. This would solve the problem of working in (almost) Coffeescript on someone else's project written in Javascript. I'm stuck right now because I can't get the number of changed lines in GIT down to an acceptable level. See https://github.com/mark-hahn/jsw https://github.com/mark-hahn/jsw.
- daemin 11y agoIt could, but the goal would be to store the code as rich text not plain text. So it would have to be decomposed to an AST and then stored in some structured format - XML for example. This means that all of these existing tools that deal with just plain text would need modifications to handle the richer file format. Having it as rich text in the editor and then saving it out as a plain text file means you're just making a rich code editor.