All Projects → ktakashi → R6rs Msgpack

ktakashi / R6rs Msgpack

MessagePack for R6RS Scheme / msgpack.org[Scheme]

Programming Languages

scheme
763 projects

Projects that are alternatives of or similar to R6rs Msgpack

Mpack
MPack - A C encoder/decoder for the MessagePack serialization format / msgpack.org[C]
Stars: ✭ 282 (+1914.29%)
Mutual labels:  msgpack, messagepack
Msgpack Cli
MessagePack implementation for Common Language Infrastructure / msgpack.org[C#]
Stars: ✭ 761 (+5335.71%)
Mutual labels:  msgpack, messagepack
what-the-pack
Ultra-fast MessagePack for NodeJS & Browsers | msgpack.org[Javascript/NodeJS]
Stars: ✭ 36 (+157.14%)
Mutual labels:  msgpack, messagepack
Msgpack11
A tiny MessagePack library for C++11 (msgpack.org[C++11])
Stars: ✭ 78 (+457.14%)
Mutual labels:  msgpack, messagepack
Msgpack Rust
MessagePack implementation for Rust / msgpack.org[Rust]
Stars: ✭ 561 (+3907.14%)
Mutual labels:  msgpack, messagepack
rcppmsgpack
MsgPack Headers for R / msgpack.org[R]
Stars: ✭ 17 (+21.43%)
Mutual labels:  msgpack, messagepack
sbp
Structured Bindings Pack - serialize C++ structs into MessagePack binary form
Stars: ✭ 16 (+14.29%)
Mutual labels:  msgpack, messagepack
msgpack-perl
MessagePack serializer implementation for Perl / msgpack.org[Perl]
Stars: ✭ 48 (+242.86%)
Mutual labels:  msgpack, messagepack
Msgpack Javascript
MessagePack for JavaScript/TypeScript/ECMA-262 / msgpack.org[JavaScript]
Stars: ✭ 742 (+5200%)
Mutual labels:  msgpack, messagepack
Remarshal
Convert between CBOR, JSON, MessagePack, TOML, and YAML
Stars: ✭ 421 (+2907.14%)
Mutual labels:  msgpack, messagepack
msgpack-asgi
Drop-in MessagePack support for ASGI applications and frameworks
Stars: ✭ 100 (+614.29%)
Mutual labels:  msgpack, messagepack
Msgpack.php
A pure PHP implementation of the MessagePack serialization format / msgpack.org[PHP]
Stars: ✭ 327 (+2235.71%)
Mutual labels:  msgpack, messagepack
kotlinx-serialization-msgpack
MsgPack support for kotlinx.serialization -- msgpack.org[kotlinx.serialization]
Stars: ✭ 17 (+21.43%)
Mutual labels:  msgpack, messagepack
Json
JSON for Modern C++
Stars: ✭ 27,824 (+198642.86%)
Mutual labels:  msgpack, messagepack
Messagepack Csharp
Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#]
Stars: ✭ 3,668 (+26100%)
Mutual labels:  msgpack, messagepack
Gosercomp
⚡️ Golang Serializer Benchmark Comparison
Stars: ✭ 300 (+2042.86%)
Mutual labels:  messagepack
Cpp Serializers
Benchmark comparing various data serialization libraries (thrift, protobuf etc.) for C++
Stars: ✭ 533 (+3707.14%)
Mutual labels:  msgpack
Surging
Surging is a micro-service engine that provides a lightweight, high-performance, modular RPC request pipeline. The service engine supports http, TCP, WS,Grpc, Thrift,Mqtt, UDP, and DNS protocols. It uses ZooKeeper and Consul as a registry, and integrates it. Hash, random, polling, Fair Polling as a load balancing algorithm, built-in service gove…
Stars: ✭ 3,088 (+21957.14%)
Mutual labels:  messagepack
Arq
Fast job queuing and RPC in python with asyncio and redis.
Stars: ✭ 695 (+4864.29%)
Mutual labels:  msgpack
Airframe
Essential Building Blocks for Scala
Stars: ✭ 442 (+3057.14%)
Mutual labels:  msgpack

MessagePack for R6RS Scheme

This is an implementation of MessagePack for R6RS Scheme.

API references

Function (pack! bv message)
Function (pack! bv message offset)

Pack message to message pack format bytevector and put it into the bv destructively. Given bv must have enough length to hold the message.

Optional argument offset indicates where to start with, default is 0.

Function (pack message)

The same as pack! but this one creates a new bytevector.

Function (pack-size message)

Calculate the converted message size.

Function (unpack bv)
Function (unpack bv offset)

Unpack the given message format bytevector to Scheme object.

Optional argument offset indicates where to start with, default is 0.

Function (get-unpack in)

Unpack the given binary input port to Scheme object.

Conversion rules

As you already know, Scheme doesn't have static types so the conversion of Scheme objects to message pack data might cause unexpected results. To avoid it, I will describe how conversion works.

Scheme to message pack

Integer conversion

The library automatically decides proper size. More specifically, if it can fit to message pack's fixnum then library uses it, so are uint8-64. If the number is too big, then an error is raised. Users must know it tries to use uint as much as possible. If the given number was negative then sint will be used.

Floating point conversion

Unfortunately R6RS doesn't have difference between float and double. So when flonum is given then it always converts to double number.

Collection conversion

Message pack has collections which are map and array. And these are associated with alist (association list) and vector respectively. When you want to convert alist to message pack data, then you need to make sure the cdr part will be the data and if you put (("key" "value))_ then it will be converted to nested map.

The collection size calculation is done automatically. It tries to use the smallest size.

Message pack to Scheme

The other way around is easy, it can simply restore the byte data to Scheme object. Following describes the conversion rules;

Positive fixnum -> integer
Negative fixnum -> integer
uint8, uint16, uint32, uint64 -> integer
sint8, sint16, sint32, sint64 -> integer
Map -> alist
Array -> vector
fixstr, str8, str16, str32 -> string bit8, bit16, bit32 -> bytevector

Tested Scheme implementations

Sagittarius Scheme

Mosh Scheme

Ypsilon

Your contributions are always welcome.

TODO

  • More testing
  • Extended type handling
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].