Skip to content

Is there some kind of optimized wire format for the syntax tree? #188

Answered by ChristianMurphy
skirsten asked this question in Q&A
Discussion options

You must be logged in to vote

Unified and ASTs aren't really a wire protocol.
It is an AST parsing system.
Due to it's highly pluggable and dynamic design, its usage to process text documents (which usually don't have extremely complex trees, it is mostly text), and being JavaScript based; JSON is a good fit for its internal format.

Given all that marshaling data into a wire format like: ProtoBuff, Cap'n Proto, FlatBuffer, etc aren't likely to have a significant packet size or performance improvement over say gzip or brotli compressing JSON.
Because:

  • Most of the content is text (which compression can shrink, but a wire protocol generally won't)
  • Of the wrapping content, the AST metadata, it is dynamic enough (with new…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ChristianMurphy
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants