Skip to content
This repository has been archived by the owner on Jun 22, 2021. It is now read-only.

IDL preprocessor step #82

Open
kriskowal opened this issue Oct 22, 2015 · 4 comments
Open

IDL preprocessor step #82

kriskowal opened this issue Oct 22, 2015 · 4 comments

Comments

@kriskowal
Copy link
Contributor

Parse Thrift IDL to an intermediate JSON representation to avoid re-parsing with PEGJS at startup time in services.

cc @Matt-Esch for raising the issue of startup times
cc @Raynos for bringing to my attention
cc @malandrew @jcorbin for go team thriftrw

@Matt-Esch
Copy link

I actually have a branch that postinstall builds the parser. I'll put up a pr soon but really this shouldn't be an issue. If projects pre-parse their thrift files and dump the AST, and assuming we can opt out of building the parser (i.e. stop eagerly building it on require) then there is no need to run this pre-processor step in production services.

@Matt-Esch
Copy link

#83

@kriskowal
Copy link
Contributor Author

Let’s make a PR that conditionally builds the PEGJS parser. We can encourage services to build a JSON dump of the syntax tree and provide an interface that accepts the JSON AST in addition to the source text, bypassing the parse step. (The source is still needed for Meta::thriftIDL)

@kriskowal
Copy link
Contributor Author

  • make type properties enumerable on syntax tree objects (ast.js)
  • expose tool for parsing ThriftIDL to JSON
  • expose interface for accepting syntax alongside source (or syntaxes alongside sources for the imports feature eventually)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants