PureBasic - MsgPack

PureBasic Include for serializing and deserializing MessagePack data.

Based on the msgpack/msgpack specification.

Features

  • Full support of the MessagePack specification
  • Explicit or implicit data formats when reading/writing
    • ReadInteger vs ReadI8/ReadU8/...
  • Fully documented

Limitations

  • No custom malloc/realloc/free callbacks
  • More involved Map and Array interactions
    • No dynamic typing
    • Building arrays/maps requires special insertion in parent MsgPack (See examples)
    • Lots of internal checks for boundaries and counts before any reading can be done
  • Usage of larger .q type for field sizes
    • Helps prevent unsigned numbers causing issues on x86
  • Particular handling of NaN for Float32 and Float64
    • 0x7F800001 gets returned as 0x7FC00001 (x87 FPU limitation)
    • ARM64 untested yet
  • No implementation of the Timestamp extension

Usage

Submodule

Adding as a submodule:

git submodule add https://github.com/aziascreations/PB-MessagePack.git Includes/PB-MessagePack

Pull latest submodule version:

git submodule update --init --recursive

TODO: Add note about handling pre-inclusion of PB-Endianness

Inclusion

...

Examples

Explicit vs Implicit typing

Cloning

Use this command to clone the repository and its submodules:

git clone --recurse-submodules https://github.com/aziascreations/PB-MessagePack.git

If you forgot the submodules, use this command:

git submodule update --init --recursive

Special Thanks

License

All the code in this repo is released in the Public Domain.

Languages
PureBasic 92.9%
PowerShell 4%
C# 1.8%
Python 1.3%