Skip to content

MessagePack implementation for OCaml / msgpack.org[OCaml]

Notifications You must be signed in to change notification settings

isabella232/msgpack-ocaml

 
 

Repository files navigation

MsgPack for OCaml

BULID

$ make
$ sudo make install

EXAMPLE

Serialize/Deserialize for Msgpack Object

(* serialize *)
let bytes = 
  Msgpack.Serialize.serialize_string (`FixArray [`PFixnum 1; `PFixnum 2; `PFixnum 3])

(* deserialize *)
let obj =
  Msgpack.Serialize.deserialize_string bytes

Serialize/Deserialize for OCaml types (with meta_conv)

open Msgpack_conv

type t = {
  int : int;
  str : string;
} with conv(msgpack)

(* serialize *)
let bytes = 
  Msgpack.Serialize.serialize_string (msgpack_of_t { int = 42; str = "ans" })

(* deserialize *)
let obj =
  t_of_msgpack (Msgpack.Serialize.deserialize_string bytes)

See also, examlpe/

DEVELOPMENT

Setup development enviroment with docker:

$ docker-compose build
$ docker-compose run app

TEST

$ ocaml setup.ml -configure --enable-tests
$ make test

PROOF

If you want to use msgpack at OCaml, you need not do this section. This section for user intrested in formal verification.

You need Coq 8.4 and omake.

$ cd proof
$ make
$ cp *.ml* ../lib/core

About

MessagePack implementation for OCaml / msgpack.org[OCaml]

Resources

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • OCaml 79.2%
  • Coq 19.6%
  • Makefile 1.2%