Coder Social home page Coder Social logo

msgpack-scheme's Introduction

MessagePack implementation for CHICKEN scheme

An implementation of MessagePack for CHICKEN scheme.

API Specification

Primitive pack-family procedures:

(pack-uint PORT value)
(pack-sint PORT value)
(pack-float PORT FLONUM)
(pack-double PORT FLONUM)
(pack-bin PORT BYTE-BLOB)  ; byte-blob
(pack-str PORT STRING)     ; string
(pack-array PORT VECTOR)   ; vector
(pack-map PORT HASH-TABLE) ; hash-table
(pack-ext PORT EXT)        ; extension (see below)

Additionally, this implementation provides a generic pack procedure:

(pack PORT value)

This procedure will call primitive type packers, with the following rules:

  • if the value has a packer, apply it.
  • if the value is a string, it will be packed as str.
  • if the value is a blob, it will be packed as bin.
  • if the value is a char, it will be packed as a uint.
  • if the value is a list, it will be packed as an array.
  • if the value is a extension (see below), it will be packed as an ext

Unpack procedures:

(unpack PORT [mapper])

Extension

Extension is record defined as:

- type: integer from 0 to 127
- data: a byte-blob

(define-record extension type data)

Example:

(make-extension 10 (string->byte-blob "hi"))

License

Distributed under the New BSD License.

msgpack-scheme's People

Contributors

hugoarregui avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

great-scott

msgpack-scheme's Issues

Update egg to the latest mspack spec

Spec

Missing types

  • fixstr
  • str8,16,32
  • bin8,16,32
  • ext8,16,32
  • fixext 1,2,4,8,16

Other

  • Raw seems to be merged into str and bin (actually the old raw16 and raw32 headers are the current str16 and str32 ones)
  • The spec is not clear (IMHO) about how to handle strings, my current understanding is
      1. they assume utf-8: problem, chicken doesn't handle utf8 very well
      1. they expect to transform a str* into a string

Port to Chicken 5

Hello,
I just ported you egg to Chicken 5 and cleaned up a bit. Do you want me to do a pull request or would you rather lend me the ownership of the package for chicken 5 ? (I would keep the BSD licence, also I am not sure how I should modify the copyright)

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.