Git Product home page Git Product logo

cl-messagepack's Introduction

-- markdown --

CL-MESSAGEPACK

A Common Lisp implementation of the MessagePack (http://msgpack.org/) serialization/deserialization format, implemented according to http://wiki.msgpack.org/display/MSGPACK/Format+specification.

Depends on flexi-streams and babel. Floating point values are supported only on SBCL currently.

Status: first draft encoder and decoder implemented, added extensions for some Lisp data types (see below), simple tests.

Extensions to the Message Pack specification

(C4) 'Pure' Cons

A 'pure' cons is a cons whose CDR is not a cons. Regular lists are encoded as Message Pack arrays, but we need something special for conses.

The pure cons is encoded as byte #xC4, followed by the encodings of the CAR of the cons and the encoding of the CDR of the cons.

(C5) Symbol

In order to be able to restore the symbols as symbols, we can't simply encode them as strings. So a symbol will be encoded as byte #xC5, followed by the name of the package of the symbol, followed by the name of the symbol.

(C6) Symbol as number

Since encoding symbols should be shorter than encoding strings, we can encode them as numbers, provided that the encoder and decoder both have knowledge of a symbol <-> integer bijection between the symbols and the numbers. A symbol that is found in this table will be encoded as byte #xC6, followed by the encoding of its corresponding integer.

(C7) Rationals

Rationals are encoded as byte #xC7, followed by the encoding of the numerator, and the encoding of the denominator. If the numerator cannot be encoded as an integer (it is too large to be encoded as an uint64 or an int64, it will be encoded as a string. The same happens for large denominators).

Testing

Copy the cl-messagepack directory to the local-projects directory of your Quicklisp install, then

(require :cl-messagepack)
(fiveam:run! 'mpk-tests::cl-messagepack-tests)

in a REPL (tested under SBCL and CCL under Linux x64).

cl-messagepack's People

Contributors

mbrezu avatar

Watchers

James Cloos avatar DAMAPL avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.