3 ms·
Can 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.
by benrbray 5y ago
Can 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.