Protobuf

Story

I did not find a protobuf implementation for d so I thought:

  • Learn a little about the protobuf internals.
  • See how to generate source with d.
  • Use my parser combinator library to implement a not so minimal parser example.
  • And create a useful library to interact with the rest of the world.
All at the same time.
Implementation

The project consists of several parts:

  • some small helper classes that are kind of a runtime for the generated sources.
  • some tests written in java to generate protobuf files which are used to check the results from the generator.
  • the compiler itself (it is implemented by first writing a parser from scratch (I know ... dont do this at home and use the protobuf parser)).
  • integration tests, that use the java-references to check if everything is compatible.

Please check the d examples in compiler/tests (e.g. the canonical addressbook tests for the generated api).

Restrictions

Neither the service part nor the extension part is currently implemented.

Sources
The sources are located in my private assembla repository. Feel free to contact me if you want to try them out.