4 ms·
tbh the on-disk storage format is pretty irrelevant, its all just bits and bytes on disk anyways. for many cases you can consider source text a serialization of
by zokier 3y ago
tbh the on-disk storage format is pretty irrelevant, its all just bits and bytes on disk anyways. for many cases you can consider source text a serialization of ast; no matter how you store it you still need to parse the data somehow. Sure some formats are easier to parse than others (hello sexprs), but that is just minor perf aspect, conceptually its all the same.
this closely relates to the missing type discussion, there is no universal "tree" type, and as such it is also difficult to construct any universal "ast" type; different uses need trees structured in different ways: https://news.ycombinator.com/item?id=39592444 https://news.ycombinator.com/item?id=39592444
- owlstuffing 3y ago> tbh the on-disk storage format is pretty irrelevant, it’s all just bits… Nonsense. A completely attributed AST is the result of a full parse. The information in the AST is vastly richer than source. > there is no universal tree type Obviously. It should be understood that the idea is to have a standard AST API/format _per language_. As such it would be standard practice to provide this information as part of the parser/compiler library.