Giter VIP home page Giter VIP logo

msgpack-smalltalk's Introduction

msgpack-smalltalk

CI

MessagePack serialization library for various Smalltalk dialects.

  • Squeak
  • Pharo
  • VisualWorks
  • VA Smalltalk
  • Dolphin Smalltalk
  • GNU Smalltalk (Beta)
  • Cuis

Sources are put as Cypress for the neutral accesses from various Smalltalk dialects.

How to use

Serialization

MpMessagePack pack: <your object>

or:

<your object> messagePacked

Deserialization

MpMessagePack unpack: msgpackBytes

or:

Object fromMessagePack: msgBytes

Samples

map := Dictionary new.
map at: 'someArray' asByteArray put: #(1 2.2 #[3 4 5]).
packed := map messagePacked.
(Object fromMessagePack: packed) inspect.
writeStream := WriteStream on: ByteArray new.
encoder := MpEncoder on: writeStream.
encoder nextPut: 1.
encoder nextPut: #(2 3).
dic := Dictionary new.
dic at: 4 put: 5.
encoder nextPut: dic.
encoder nextPut: 'four' asByteArray.
bytes := encoder contents.
readStream := ReadStream on: bytes.
decoder := MpDecoder on: readStream.
[decoder atEnd] whileFalse: [
        Transcript cr; show: decoder next printString
]

How to install

Please read HowToInstall.md.

Loading the latest development version

Squeak 4

Installer squeaksource
    project: 'MessagePack';
    install: 'ConfigurationOfMessagePack'. 
(Smalltalk at: #ConfigurationOfMessagePack) project development load

Pharo & Squeak 5+

Metacello new
  baseline: 'MessagePack';
  repository: 'github://msgpack/msgpack-smalltalk:develop/repository';
  load.

You might need MpTypeMapper initializeAll on new encoder/decoder-related updates.

Limitation on Squeak 5+

Starting with Squeak 5 and 6, DateAndTime only supports microsecond precision. Because of this, nanosecond values are not properly decoded as DateAndTime. Two unit tests (testPackUnpackTimestamp64, 96) fail on Squeak 5 and 6.

msgpack-smalltalk's People

Contributors

kgardas avatar mumez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

msgpack-smalltalk's Issues

Squeak 5.0 - 4 unit tests fail

Probably because of underlying representation change, several unit test fail under Squeak 5.0.

I am not a Squeak user and have not taken a close look at this.

FYI,
-KenD

Pharo 4.0 String errors

This script produces an error on Pharo 4.0 as well as on Gemstone.
The size of the to bytes converted String seems to be written wrong...

|dict|

dict := (Dictionary new at: '1234567890123456' put: data; yourself)
messagePacked: [:settings | settings stringAsBytes: true ].

Object fromMessagePack: dict setting: [:se | se bytesAsString: true.]

Gemstone port

Hi!

I ported this package to Gemstone.
To make Messagepack-Core loadable into Gemstone I had to change some code due to compiler restrictions.

MpConstants implements the following reserved methods.
nil
false
true

I renamed them to
undefinedNil
boolFalse
boolTrue

This change also has to be introduced to all the senders of these methods.
All other needed changes can be handled via class extensions.

Would it be possible to add those changes to the MessagePack core?

Thanks
Sebastian

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.