parser/ast as separate library
Description I wanted to play around with typical and evetually integrating it into tonic. For this purpose it would be convenient to have schema parsing as a library.
Alternatives considered I coul dtake inspiration and rewrite parsing, but it exists ;)
Integrating into tonic seems worthwhile! But I'm not sure what it would take exactly. Does tonic allow prost to be swapped with something else?
BTW, if you want to prototype it, the parser is in parser.rs. This is the entrypoint:
https://github.com/stepchowfun/typical/blob/fbef90eafa1069f4fef0c28c83b1473f6e16b92d/src/parser.rs#L195-L199
tonic recently pushed out all prost related code into two crates that implement some traits. so that should be quite easy.
https://github.com/hyperium/tonic/tree/master/tonic-prost https://github.com/hyperium/tonic/tree/master/tonic-prost-build
one crate handles message (and service; which i could hard code for tests) generation, and the other crate implements a "codec" and defines how messages are de-/serialized