taoensso / nippy

The fastest serialization library for Clojure
https://www.taoensso.com/nippy
Eclipse Public License 1.0
1.04k stars 60 forks source link

Offer public API for Nippy type info #151

Closed ptaoussanis closed 4 months ago

ptaoussanis commented 1 year ago

Relevant for: #147, #140 (esp. comment).

Nippy's data format consists of 2x main parts:

  1. Nippy's internal schema: mostly just the set of [byte-id type length] tuples.
  2. The encoding of base types as per java.io.DataOutput and optional compression/encryption.

(1) is currently defined by a private var (nippy/type-ids).

The discussion on #140 concluded that it'd be useful for (1) to be made somehow public.

Just making the current nippy/type-ids private var public would not be ideal- we can probably offer a more convenient API to the same info.

Comments/PRs welcome for ideas, otherwise I'll try take a look at this next time I'm doing some batched work on Nippy.

ptaoussanis commented 1 year ago

@refset Hi Jeremy, just checking if this issue is still relevant for you? I'm prioritising open-source work atm, and this is a candidate for one of my next tasks.

Thanks

ptaoussanis commented 1 year ago

@refset I had an opportunity today, so just went ahead with this. Have pushed [com.taoensso/nippy "3.3.0-alpha2"] to Clojars with the following experimental new var.

From my understanding of your objective, this should hopefully allow you to write a much simpler version of your get-len utility.

Feedback welcome.

Cheers

refset commented 1 year ago

Hey @ptaoussanis - thanks a lot for this, it looks great :) we'll try to find some time to kick the tyres properly soon!