Skip to content

devn/longshi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Longshi

A ClojureScript implementation of fressian.

Goals

  • Performance - Encoding and decoding should be as fast as possible.
  • Not an island - The implementation should be available for JavaScript, ClojureScript and be able to run on modern JavaScript platforms (i.e. browsers, nodejs, etc.)
  • Minimal dependencies - The only dependencies are ClojureScript and the Google Closure library.
  • Minimal Size - For the browser implementation, the file size should be as small as possible.

Status

Snapshot release - Still getting all fressian features implemented. The API will closely mirror data.fressian.

Differnces from the canonical (java) implementation

  • Numbers - Due to JavaScript numbers being doubles, the maximum integer returned on the decoding side is -2^52 to (2^52 - 1) and anything over that is a Google Closure long object.
  • Caching - Since JavaScript doesn't have a default hashing implementation for its objects, (ala Object.hashCode in Java) and in addition to a type's handler having encoding and decoding functions, an optional hashing function can be supplied. This is so that the caching implementation can be efficient.
  • Data Types - JavaScript objects will be in the default set of handlers. The Map, Set, Vector, and List handlers will be ClojureScript data types.

Fressian Undocumented Assumptions

  • CRC Checksum using Adler-32 (in RawOutput and RawInput)
  • Endianness - The endianness of fressian is the endianness of Java, which is big endian.

Compatability

The JavaScript implementation needs to have Typed Arrays and DataView.

About

Fressian for ClojureScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors