mransan / ocaml-protoc

A Protobuf Compiler for OCaml
https://mransan.github.io/ocaml-protoc/
MIT License
179 stars 33 forks source link

large refactor, plugins, single-file codegen #213

Closed c-cube closed 11 months ago

c-cube commented 1 year ago

The goal of this PR is to streamline the code generation for ocaml-protoc and cleanup the code. This would help me add new code generation plugins[^1] and also reduce the sprawl of files produced by ocaml-protoc.

This is very much breaking:

In addition, the compiler lib can be directly used to generate code from a .proto, giving it a list of plugins, without requiring Cmdline.t.

[^1]: my plans are: expose mutable records (or have an option to directly make all records mutable in the first place); and codegen for services

c-cube commented 1 year ago

@Lupus this is not finished but it's what I had in mind. With this it should be easier to add more Plugin.t to generate services, etc.