4 ms·
using a lisp here simplifies things from implementation and interaction model perspectives. you already have a simple, canonical AST out of the box, which in-pr
by disconcision 5y ago
using a lisp here simplifies things from implementation and interaction model perspectives. you already have a simple, canonical AST out of the box, which in-principle suffices to support the entire language, not just a toy version. so it makes sense lisps are attractive targets for getting something rolling in this space, though it's certainly debatable whether it's long-term the best choice.
(my own efforts in this space (a structured editor in racket), which i was able to get going as a novice programmer: https://www.youtube.com/watch?v=CnbVCNIh1NA https://www.youtube.com/watch?v=CnbVCNIh1NA)
- benrbray 5y agoCan you give an example of a language that does not have an AST?? Homoiconicity may be slightly more convenient but it is certainly not necessary.
- disconcision 5y agoit depends what you mean by 'have'. any language in-principle probably has something describable as an AST but it's not necessarily something particularly well-specified. you can derive a CST from a presentation of the grammar, but it's not necessarily easy to work with in an editing context. in general, intermediary data structures are often left entirely to the discretion of the compiler implementer. likely various tree-like structures exist implicitly or explicitly during compilation, which may or may not be ideally suited for editing interactions. for example, if they are heavily nested with intermediary productions or discard surface style choices. sexps offer a simple (debatably too simple) shortcut here.