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

Is this clojurescript compatible? #64

Closed yatesco closed 9 years ago

yatesco commented 9 years ago

Title says it all :).

Thanks!

mpenet commented 9 years ago

It isn't, it relies heavily on external java libraries (ex. for compression), and jvm apis internaly.

yatesco commented 9 years ago

OK - thanks Max. Anyone fancy porting the JVM to ClojureScript - now that would be a fun weekend ;).

On 26 February 2015 at 11:36, Max Penet notifications@github.com wrote:

It isn't, it relies heavily on external java libraries (ex. for compression), and jvm apis internaly.

— Reply to this email directly or view it on GitHub https://github.com/ptaoussanis/nippy/issues/64#issuecomment-76163832.

mpenet commented 9 years ago

I think transit might be a good candidate for cljs, if you need something available now.

yatesco commented 9 years ago

Yeah, that is what I am using. Combined with edn and sente it is a pleasure. However, I am now looking at persisting strings to and from the database and came across this. The performance graph shocked me and the lightweight protocol required to serialise protocols hence my consideration for replacing edn.

I expect I will still use this to/from the database but retain edn for clojure->clojurescript.

On 26 February 2015 at 11:47, Max Penet notifications@github.com wrote:

I think transit https://github.com/cognitect/transit-cljs might be a good candidate for cljs, if you need something available now.

— Reply to this email directly or view it on GitHub https://github.com/ptaoussanis/nippy/issues/64#issuecomment-76165053.

ptaoussanis commented 9 years ago

Hi Colin,

Unfortunately @mpenet is correct (thanks Max!). Transit & edn are your best options right now. Edn's better for small payloads, Transit for larger ones. And both may be amenable to string compression, but that'll depend largely on the size+kind of data you're dealing with.

Note that Transit also theoretically has support for binary (MessagePack) encoding. Last I checked, it wasn't working (done?) - not sure if that's changed yet.

Hope that helps! Please feel free to close if you've got no further questions.

Cheers :-)

yatesco commented 9 years ago

Thanks all.

ptaoussanis commented 7 years ago

Since this question came up again, I'll just add here for the record that ClojureScript compatibility is specifically a non-goal for Nippy.

Core motivation for the lib was+is to get something as fast+small as possible for server-side de/serialization (for use with a db, to disk, etc.). Unfortunately a focus on speed+size is (at least in this case) intrinsically in direct opposition to portability.

More or less:

Hope that helps!