thriftrw / thriftrw-node

A thrift binary encoding library using bufrw
MIT License
57 stars 25 forks source link

IDL preprocessor step #82

Open kriskowal opened 9 years ago

kriskowal commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

https://github.com/uber/thriftrw/pull/83

kriskowal commented 9 years ago

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 commented 9 years ago