ANN: 1.0 GA of ProtoPoet, Java API for generating Protobuf files

72 views
Skip to first unread message

Derek Perez

unread,
Jun 2, 2018, 3:08:26 PM6/2/18
to Protocol Buffers
Hey all,

I've been working on this project in my spare time and its finally at what I would call 1.0 level. The concept was inspired by Square's JavaPoet library for Java which is used to generated Java source code. This library generates Protobuf source code with an intuitive Java API. There's a javadoc, README examples, and the code is pretty easy to read/follow. Hope someone else finds it useful!

https://github.com/perezd/protopoet

Josh Humphries

unread,
Jun 3, 2018, 10:32:13 PM6/3/18
to Derek Perez, Protocol Buffers
Hey, Derek,
This looks like a pretty cool project. One interesting thing about protos is that the language model has value outside of just generating source code: the same API should be able to serve the purpose of generating descriptors, for runtime/dynamic usage of protobufs. Is that a feature of this library by chance?

While this is targeted as Java, if anyone building stuff in Go has need for something similar, I've built very similar functionality into one of my own Go projects: https://github.com/jhump/protoreflect

In particular, the desc/builder package provides a similar API, for building a model of proto source files and elements. But its output is not generated source code but instead descriptors. One can then use the desc/protoprint package to generate source files from those descriptors.


FWIW, I am also a fan of Java Poet and recently began work on something similar, but for generating Go code. (I of course called it Go Poet.) It's a long way from version 1, but maybe when it gets to that milestone, I'll post an announcement about it to the go-nuts mailing list.



----
Josh Humphries
jh...@bluegosling.com

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscribe@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Derek Perez

unread,
Jun 4, 2018, 11:12:06 AM6/4/18
to Josh Humphries, Protocol Buffers
Hi Josh, thanks for the notes. Agreed there are many great ways to use protobuf, my main needs are source code oriented, so I'm scratching my own itch :). 

On Sun, Jun 3, 2018, 7:32 PM Josh Humphries <jh...@bluegosling.com> wrote:
Hey, Derek,
This looks like a pretty cool project. One interesting thing about protos is that the language model has value outside of just generating source code: the same API should be able to serve the purpose of generating descriptors, for runtime/dynamic usage of protobufs. Is that a feature of this library by chance?

While this is targeted as Java, if anyone building stuff in Go has need for something similar, I've built very similar functionality into one of my own Go projects: https://github.com/jhump/protoreflect

In particular, the desc/builder package provides a similar API, for building a model of proto source files and elements. But its output is not generated source code but instead descriptors. One can then use the desc/protoprint package to generate source files from those descriptors.


FWIW, I am also a fan of Java Poet and recently began work on something similar, but for generating Go code. (I of course called it Go Poet.) It's a long way from version 1, but maybe when it gets to that milestone, I'll post an announcement about it to the go-nuts mailing list.



----
Josh Humphries
jh...@bluegosling.com
On Sat, Jun 2, 2018 at 3:08 PM, Derek Perez <de...@perez.earth> wrote:
Hey all,

I've been working on this project in my spare time and its finally at what I would call 1.0 level. The concept was inspired by Square's JavaPoet library for Java which is used to generated Java source code. This library generates Protobuf source code with an intuitive Java API. There's a javadoc, README examples, and the code is pretty easy to read/follow. Hope someone else finds it useful!

https://github.com/perezd/protopoet

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages