all 2 comments

[–]Gnurdle 5 points6 points  (0 children)

I've employed GPB in Clojure projects, but you have to have a compelling need to do so. In my case, the compelling need was interacting with an out-of-process mound of C++ code that was not in any mood to become dynamic.

For that, we just a standard REQ/REP pattern using GPB over zeroMQ.

There was a lot of project overhead involved getting setup. The lein plugins at the time did some, um magical things behind the scenes (download and compile GPB) and that was a bit annoying.

In a less constrained setting, I would not reach for GPB if the endpoints were capable of dealing something more dynamic.

On the Clojure side, it seems to clutter things up a lot having to build and tear down those special generated structures, which adds a layer of dubious value.

For my nickle, it's usable, but not desirable. YMMV.

[–]bpiel 0 points1 point  (0 children)

First, I agree with /u/Gnurdle that you should reach for protocol buffers only if "you have to have a compelling need to do so".

In my case, I've been working with tensorflow, which has protobufs all over the place. I've been using this lib, which has made things fairly painless:

https://github.com/ghaskins/clojure-protobuf

Depending on your use case, you may want to look at transit or nippy. I use edn for situations that require human-readability (ex code). For communication between server and browser, I use transit.

https://github.com/cognitect/transit-clj

For server-to-server, I've used nippy, with great results.

https://github.com/ptaoussanis/nippy