package pbrt_services
Runtime library for ocaml-protoc to support RPC services
Install
dune-project
Dependency
Authors
Maintainers
Sources
ocaml-protoc-4.0.tbz
sha256=88533848ee8ad662bfb063f34932286405977fa3810515b997119b06f05105e4
sha512=df12c71f7181eafc94cd0fc400edf7f258cdd3740a5badafce097f771b7828fed9a9a9c0a457e7e118848a8b1ddd87fe3134a5bdf88d4adcb0d0e04ba6808c5f
doc/CHANGES.html
4.0
- better parsing of protobuf options
- generation of validation code with
--pp_options - feat: add
--encode-onlyand--decode-onlyfeatures take presence semantics in account, to be closer to compliance with the official protobuf docs and implementation
- use a bitfield to track presence for scalar fields
- use options in more places
- do not serialize non-present fields, to save space
- always generate
makebuilders, setters, presence checks
- merge mutable and immutable types, only generate a single record per message type
- feat codegen: use polyvariants for very large sum types
- fix parser: handle
reservedin enums - improved tests
3.1.1
- fix error in codegen for nested
oneofin yojson
3.1
- Expose one-of per-constructor options
- Support options for enum values
- expose server stubs for advanced users
- fix: only generate services from the current file
- silence warning 44 in generated code
- Use generated encoders/decoders for empty messages in rpc
breaking:
- remove bs runtime, we don't support it going forward
3.0.2
- fix segfault in pbrt in bytecode
3.0.1
- fix bug where code for services would be generated even if
--servicesis not passed on the CLI
3.0
Major version that breaks code for every user. Sorry!
Breaking
- Generated code now always fits into 2 files: code for
foo.protois produced infoo.mlandfoo.mli. This follows a fairly large internal refactor that enables a plugin architecture internally (which facilitated codegen for services). All encoder/decoder functions also have a new name now, so that they don't collide inside the same file. - CLI flags now use
--this-stylerather than-this-style - Bump minimal OCaml version to 4.08
Performance
- encode probotufs backward, which means we can write directly into a single buffer (which is not possible in a forward mode because sub-messages require an unknown amount of prefix space to write their size as a varint)
- add C stubs for pbrt
- use Bytes functions to read/write fixed size integers
- inlining annotations
- more benchmarks, helping optimization overall
- reduce allocations drastically, by having the generated code create fewer closures
Services
- add
pbrt_servicesruntime library - generate code for
servicestatements. This is a big feature for users who want to implement RPC systems using protobuf. The generated code is agnostic to whatever RPC implementation will use it, it only packs together RPC method names and path with the relevant encoders/decoders. Services require both JSON and binary encoders/decoders to be present.
JSON
- migrate
pbrt_yojsoninto the main ocaml-protoc repo - JSON runtime support for empty messages
- Add support for bytes in JSON encoding
- Add support for encoding and decoding maps in JSON
Other features and fixes
- add
--makeflag to generatemakefunctions that take fewer optional arguments. This helps preventing the user from forgetting important arguments when they're encoding to protobuf. Arguments actually marked asoptionalin the .proto file are still optional. - Support maps/lists in options
- add Pbrt.Decoder.of_substring
- Allow options to be named like
(validate.rules).message.required - support code generation for empty messages
- Empty proto file is a valid proto as well
Testing
- expect-style tests for parser
- Tests for option parsing
- Test demonstrating parse error printing
2.4
- expose compiler library as
ocaml-protoc.compiler-lib - option to differentiate unsigned arg from signed arguments, taggings uint32/64 with
`unsigned
internal changes:
- fix(test): change integration test, protoc produces broken C++ code
- automatic generation of gh-pages
- add basic CI
- use ocamlformat
2.3
- allow
optionalin proto3 files - improve compatibility with OCaml 5
2.2
- handle
streamas a name (#179) - support hexadecimal notation for integers
- improve generated pretty printers
- move to dune 2.0
- rename runtime library to
pbrt, with a separate opam package - print bytes opaquely
2.1
- perf: nested buffer to reduce allocations for nested messages
- perf: improvements in runtime library, varint encoding/decoding, add benchmarks
- Update docs/tests to reflect that sfixed is supported
- add clear/reset to the encoder
- Add ability to parse stream modifier
2.0.3
- parsing of services