-
Notifications
You must be signed in to change notification settings - Fork 33
/
index.html
407 lines (362 loc) · 19.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="MessagePack, msgpack, JSON, Binary JSON, Serializer, Serialization" />
<!--<meta name="description" content="" />-->
<link href='favicon.ico' rel='icon' type='image/x-icon'/>
<title>MessagePack: It's like JSON. but fast and small.</title>
<!--[if lt IE 9]><script type="text/javascript" src="http://html5shim.googlecode.com/svn/trunk/html5.js" ></script><![endif]-->
<link media="all" rel="stylesheet" type="text/css" href="css/yuibase.css" />
<link media="all" rel="stylesheet" type="text/css" href="js/prettify/prettify.css" />
<link media="all" rel="stylesheet" type="text/css" href="css/all.css" />
<script type="text/javascript" src="js/all.js" ></script>
<script type="text/javascript" src="js/prettify/prettify.js" ></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-17125377-1']);
_gaq.push(['_setDomainName', 'msgpack.org']);
_gaq.push(['_anonymizeIP']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body onload="prettyPrint();changeQuickStart('qs-ruby',document.getElementById('quickstart-default'));">
<!-- Facebook like button { -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!-- } Facebook like button -->
<header id="header">
<div id="headerwrap">
<h1 id="logo"><a href="/">MessagePack</a></h1>
<nav id="topnav">
<ul>
<li><a href="https://github.com/msgpack">GitHub</a></li>
<li><a href="http://wiki.msgpack.org/display/MSGPACK/Home">Wiki</a></li>
<li><a href="http://twitter.com/search/MessagePack%20OR%20msgpack">#msgpack</a></li>
<li><a href="http://wiki.msgpack.org/display/MSGPACK/Format+specification">Spec</a></li>
</ul>
</nav>
</div>
</header>
<div id="desc">
<div id="descbody">
<img id="descimg" width="421" height="251" src="images/msgpack-json.png"/>
<div id="desctext">
<h2>It's like JSON. but fast and small.</h2>
<p>MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON but it's faster and smaller. For example, small integers (like flags or error code) are encoded into a single byte, and typical short strings only require an extra byte in addition to the strings themselves.</p>
<p>If you ever wished to use JSON for convenience (storing an image with metadata) but could not for technical reasons (encoding, size, speed...), MessagePack is a perfect replacement.</p>
<pre>> require "msgpack" # gem install msgpack
> msg = [1,2,3].to_msgpack #=> "\x93\x01\x02\x03"
> MessagePack.unpack(msg) #=> [1,2,3]</pre>
<p>...and <a href="#crosslang">many other languages</a></p>
</div>
</div>
</div>
<div id="background">
<div id="content">
<h3>Happy Hackers :-)</h3>
<div class="tmset">
<a class="tmleft"></a>
<div class="tm">
<a class="tmlogo" href="http://redis.io/"><img src="images/redis.png" alt="Redis" width="150" height="50" /></a>
<p class="tmtext">"Redis scripting has support for MessagePack because it is a fast and compact serialization format with a simple to implement specification. I liked it so much that I implemented a MessagePack C extension for Lua just to include it into Redis."</p>
<p class="tmauthor">Salvatore Sanfilippo, creator of Redis.</p>
</div>
<div class="tm">
<a class="tmlogo" href="http://pinterest.com/"><img src="images/pinterest.png" alt="Pinterest" width="197" height="50" /></a>
<p class="tmtext">"MessagePack has been simply invaluable to us. We use MessagePack + Memcache to cache many of our feeds on Pinterest. These feeds are compressed and very quick to unpack thanks to MessagePack while Memcache gives us fast atomic pushes."</p>
<p class="tmauthor">Marty Weiner, Software Engineer.</p>
</div>
<div class="tm">
<a class="tmlogo" href="http://saltstack.com/"><img src="images/saltstack.png" alt="Salt Stack" width="251" height="46" /></a>
<p class="tmtext">"I use MessagePack for all of the data serialization in Salt, it is fantastic! I tested quite a few serialization formats and MessagePack was dramatically faster and the data was always smaller. When I changed out pickles for MessagePack in Salt there was a speed increase of almost 3 fold across the board."</p>
<p class="tmauthor">Tom Hatch, author of Salt.</p>
</div>
<a class="tmright"></a>
</div>
<p class="tmcontribute">Also use MessagePack? <a href="https://github.com/msgpack/website">Waiting for your testimonial!</a></p>
<h3 id="crosslang">Implementation projects</h3>
<div class="qsset">
<ul class="qslist">
<li><a onclick="changeQuickStart('qs-ruby',this)" id="quickstart-default">Ruby</a></li>
<li><a onclick="changeQuickStart('qs-python',this)">Python</a></li>
<li><a onclick="changeQuickStart('qs-perl',this)">Perl</a></li>
<li><a onclick="changeQuickStart('qs-cpp',this)">C/C++</a></li>
<li><a onclick="changeQuickStart('qs-java',this)">Java</a></li>
<li><a onclick="changeQuickStart('qs-php',this)">PHP</a></li>
<li><a onclick="changeQuickStart('qs-javascript',this)">JavaScript</a></li>
<li><a onclick="changeQuickStart('qs-objective-c',this)">Objective-C</a></li>
<li><a onclick="changeQuickStart('qs-csharp',this)">C#</a></li>
<li><a onclick="changeQuickStart('qs-lua',this)">Lua</a></li>
<li><a onclick="changeQuickStart('qs-scala',this)">Scala</a></li>
<li><a onclick="changeQuickStart('qs-d',this)">D</a></li>
<li><a onclick="changeQuickStart('qs-haskell',this)">Haskell</a></li>
<li><a onclick="changeQuickStart('qs-erlang',this)">Erlang</a></li>
<li><a onclick="changeQuickStart('qs-ocaml',this)">OCaml</a></li>
<li><a onclick="changeQuickStart('qs-smalltalk',this)">Smalltalk</a></li>
<li><a onclick="changeQuickStart('qs-go',this)">Go</a></li>
<li><a onclick="changeQuickStart('qs-labview',this)">LabVIEW</a></li>
</ul>
<div id="quickstart" class="qsholder"></div>
<div id="qs-ruby" class="qs">
<h4>Ruby</h4>
<ul class="hlist">
<li><a href="http://msgpack.org/rdoc/current/MessagePack.html">API Reference</a></li>
<li><a href="http://rubygems.org/gems/msgpack">RubyGems</a></li>
</ul>
<pre class="prettyprint">gem install msgpack</pre>
<pre class="prettyprint">require "msgpack"
msg = [1,2,3].to_msgpack #=> "\x93\x01\x02\x03"
MessagePack.unpack(msg) #=> [1,2,3]</pre>
<p>Ruby implementation provides <a href="http://msgpack.org/rdoc/current/MessagePack/Unpacker.html">streaming deserializer</a>.</p>
</div>
<div id="qs-python" class="qs">
<h4>Python</h4>
<ul class="hlist">
<li><a href="http://pypi.python.org/pypi/msgpack-python/">PyPI</a></li>
</ul>
<pre class="prettyprint">easy_install msgpack-python</pre>
<pre class="prettyprint">import msgpack
msg = msgpack.packb([1,2,3]) #=> "\x93\x01\x02\x03"
msgpack.unpackb(msg) #=> [1,2,3]
help(msgpack)</pre>
<p>Python implementation provides streaming deserializer.</p>
</div>
<div id="qs-perl" class="qs">
<h4>Perl</h4>
<ul class="hlist">
<li><a href="http://search.cpan.org/~tokuhirom/Data-MessagePack/lib/Data/MessagePack.pm">API Reference</a></li>
<li><a href="http://search.cpan.org/~tokuhirom/Data-MessagePack/">CPAN</a></li>
</ul>
<pre class="prettyprint">cpan Data::MessagePack</pre>
<pre class="prettyprint">use Data::MessagePack;
my $packed = Data::MessagePack->pack($dat);
my $unpacked = Data::MessagePack->unpack($dat);</pre>
<p>Perl implementation provides <a href="http://search.cpan.org/~typester/Data-MessagePack-Stream/lib/Data/MessagePack/Stream.pm">streaming deserializer</a>.</p>
</div>
<div id="qs-cpp" class="qs">
<h4>C/C++</h4>
<ul class="hlist">
<li><a href="https://github.com/msgpack/msgpack-c">GitHub</a></li>
<li><a href="http://wiki.msgpack.org/display/MSGPACK/QuickStart+for+C+Language">Quick Start for C</a></li>
<li><a href="http://wiki.msgpack.org/pages/viewpage.action?pageId=1081387">Quick Start for C++</a></li>
</ul>
<pre class="prettyprint">port install msgpack # MacPorts
brew install msgpack # Homebrew
apt-get install libmsgpack-dev # Ubuntu</pre>
<p>Or download <a href="http://msgpack.org/releases/cpp/msgpack-0.5.7.tar.gz">msgpack-0.5.7.tar.gz</a> and build it to install.</p>
<pre class="prettyprint">#include <msgpack.hpp>
struct myclass { std::vector<int> vec; MSGPACK_DEFINE(vec); };
msgpack::pack(buffer, vec);
msgpack::unpack(&result, buffer.data(), buffer.size());</pre>
</div>
<div id="qs-java" class="qs">
<h4>Java</h4>
<ul class="hlist">
<li><a href="http://msgpack.org/javadoc/current/">API Reference</a></li>
<li><a href="http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.msgpack%22%20AND%20a%3A%22msgpack%22">Maven</a></li>
<li><a href="https://github.com/msgpack/msgpack-java">GitHub</a></li>
</ul>
<pre class="prettyprint">import org.msgpack.MessagePack;
MessagePack msgpack = new MessagePack();
byte[] bytes = msgpack.write(object);
MyClass object = msgpack.read(bytes, MyClass.class);</pre>
<p>Java implementation provides <a href="http://msgpack.org/javadoc/current/org/msgpack/unpacker/package-summary.html">streaming deserializer</a>, <a href="http://msgpack.org/javadoc/current/org/msgpack/type/package-summary.html">dynamically typed objects</a>, <a href="http://msgpack.org/javadoc/current/org/msgpack/template/package-summary.html">type conversion templates</a>, <a href="http://msgpack.org/javadoc/current/org/msgpack/template/builder/package-summary.html">dynamic template generators</a> and <a href="http://msgpack.org/javadoc/current/org/msgpack/annotation/package-summary.html">annotations</a>.</p>
<p>Take a look at <a href="https://github.com/msgpack/msgpack-java/tree/master/src/test/java/org/msgpack">test cases</a> for examples.</p>
</div>
<div id="qs-php" class="qs">
<h4>PHP</h4>
<ul class="hlist">
<li><a href="http://wiki.msgpack.org/display/MSGPACK/QuickStart+for+PHP">Quick Start</a></li>
</ul>
<pre class="prettyprint">git clone https://github.com/msgpack/msgpack-php.git
cd msgpack-php
phpize
./configure && make && make install</pre>
<pre class="prettyprint">$data = array(0=>1,1=>2,2=>3);
$msg = msgpack_pack($data);
$data = msgpack_unpack($msg);</pre>
</div>
<div id="qs-javascript" class="qs">
<h4>JavaScript</h4>
<ul class="hlist">
<li><a href="https://github.com/msgpack/msgpack-javascript">GitHub</a></li>
<li><a href="https://raw.github.com/msgpack/msgpack-javascript/master/msgpack.js">msgpack.js</a></li>
</ul>
<pre class="prettyprint">var myByteArray = msgpack.pack(myObject);
myObject = msgpack.unpack(myByteArray);</pre>
<p>Licensed under MIT license.</p>
</div>
<div id="qs-objective-c" class="qs">
<h4>Objective-C</h4>
<ul class="hlist">
<li><a href="https://github.com/msgpack/msgpack-objectivec">GitHub</a></li>
</ul>
<pre class="prettyprint">
#import "MessagePack.h"
..
NSData* packed = [someArray messagePack];
NSArray* someArray = [packed messagePackParse];
</pre>
</div>
<div id="qs-csharp" class="qs">
<h4>C#</h4>
<ul class="hlist">
<li><a href="https://github.com/msgpack/msgpack-cli">GitHub</a></li>
<li><a href="https://github.com/yfakariya/msgpack/wiki/">Wiki</a></li>
</ul>
<pre class="prettyprint">using MsgPack.Serialization;</pre>
<pre class="prettyprint">var serializer = MessagePackSerializer.Create<Foo>();
serializer.Pack(foo, stream);
stream.Position = 0;
var value = serializer.Unpack(stream);</pre>
<p>You can also use C#(CLI) implementation for any other CLI (Common Language Infrastructure) languages such as Visual Basic.<br />
CLI implementation also provides streaming deserializer, some level of dynamic typing, and annotations. See <a href="https://github.com/yfakariya/msgpack/wiki/">Wiki</a> for details.</p>
</div>
<div id="qs-lua" class="qs">
<h4>Lua</h4>
Coming soon...
<!--
<ul class="hlist">
<li><a href="https://github.com/nobu-k/mplua">GitHub</a></li>
</ul>
<pre class="prettyprint">require "msgpack"
data = msgpack.pack(1, 2, 3, "strings", {"a", "r", "r", "a", "y", "s"},
{t = "a", b = "l", e = "s"; 1, 2, 3, 4})
a, b, c = msgpack.unpack(msgpack.pack(1, 2, 3))</pre>
-->
</div>
<div id="qs-scala" class="qs">
<h4>Scala</h4>
<ul class="hlist">
<li><a href="http://wiki.msgpack.org/display/MSGPACK/QuickStart+for+Scala">Quick Start</a></li>
</ul>
</div>
<div id="qs-d" class="qs">
<h4>D</h4>
<ul class="hlist">
<li><a href="http://msgpack.org/ddoc/">API Reference</a></li>
<li><a href="https://github.com/msgpack/msgpack-d">GitHub</a></li>
</ul>
<p>msgpack-d is only one file. Please add msgpack.d to your project.</p>
<pre class="prettyprint">import msgpack;
Tuple!(uint, string) receive, send = tuple(2012. "Hello D!");
auto serialized = pack(send);
unpack(serialized, receive);
assert(send == recieve);</pre>
<p>D implementation also provides streaming deserializer.</p>
</div>
<div id="qs-haskell" class="qs">
<h4>Haskell</h4>
<ul class="hlist">
<li><a href="http://hackage.haskell.org/packages/archive/msgpack/0.7.1.5/doc/html/Data-MessagePack.html">API Reference</a></li>
<li><a href="http://hackage.haskell.org/package/msgpack">hackageDB</a></li>
<li><a href="http://wiki.msgpack.org/display/MSGPACK/QuickStart+for+Haskell">Quick Start</a></li>
</ul>
<pre class="prettyprint">import Data.MessagePack
main = do
let bs = pack (1 :: Int, 3.14 :: Double, "Hello, MessagePack!")
print bs
print (unpack bs :: (Int, Double, String))
</pre>
</div>
<div id="qs-erlang" class="qs">
<h4>Erlang</h4>
<ul class="hlist">
<li><a href="http://msgpack.org/edoc/">API Reference</a></li>
<li><a href="http://github.com/msgpack/msgpack-erlang">Repository</a></li>
</ul>
<p>Write into your <a href="http://github.com/basho/rebar">rebar</a>.config:</p>
<pre class="prettyprint">{deps, [
{msgpack, ".*",
{git, "git://github.com/msgpack/msgpack-erlang.git", "HEAD"}}
]}.</pre>
<pre class="prettyprint">{Spam, _} = msgpack:pack(Ham),
Ham = msgpack:unpack(Spam).</pre>
</div>
<div id="qs-ocaml" class="qs">
<h4>OCaml</h4>
<pre class="prettyprint">
$ git clone git@github.com:msgpack/msgpack-ocaml.git
$ cd msgpack-ocaml
$ omake
$ omake install</pre>
<pre class="prettyprint">
Msgpack.Serialize.desrialize_string("\147\001\002\003");;
</pre>
<a href="https://github.com/msgpack/msgpack-ocaml/tree/master/proof">This library is mathematically proven!</a>
</div>
<div id="qs-smalltalk" class="qs">
<h4>Smalltalk</h4>
<ul class="hlist">
<li><a href="https://github.com/msgpack/msgpack-smalltalk">GitHub</a></li>
</ul>
<pre class="prettyprint">
map := Dictionary new.
map at: 'someArray' asByteArray put: #(1 2.2 #[3 4 5]).
packed := map messagePacked.
(Object fromMessagePack: packed) inspect.
</pre>
</div>
<div id="qs-go" class="qs">
<h4>Go</h4>
Coming soon...
</div>
<div id="qs-labview" class="qs">
<h4>LabVIEW</h4>
<ul class="hlist">
<li><a href="http://msgpack-labview.sf.net">SourceForge</a></li>
</ul>
Installable through the VI Package Manager using one of the compiled versions on the
<a href="https://sourceforge.net/projects/msgpack-labview/files/">downloads page</a>
</div>
</div>
<h3>Related projects</h3>
<div class="paragraphs">
<h4><a href="https://github.com/dotcloud/zerorpc-python">ZeroRPC</a> by DotCloud</h4>
<p>zerorpc is a flexible RPC implementation based on zeromq and messagepack. Service APIs exposed with zerorpc are called "zeroservices".</p>
<h4><a href="https://github.com/pfi/pficommon">pficommon</a> by Preferred Infrastructure, Inc.</h4>
<p>General purpose C++ library for Preferred Infrastructure, Inc. It includes MessagePack-RPC implementation for C++</p>
<!--
<h4><a href="http://wiki.msgpack.org/display/MSGPACK/QuickStart+for+Ruby#QuickStartforRuby-RPCQuickStartforRuby">MessagePack-RPC for Ruby</a></h4>
<p>MessagePack-RPC implementation for Ruby</p>
<h4><a href="http://wiki.msgpack.org/display/MSGPACK/QuickStart+for+Java#QuickStartforJava-MessagePackRPCforJava">MessagePack-RPC for Java</a></h4>
<p>MessagePack-RPC implementation for Java</p>
<h4><a href="https://github.com/msgpack/msgpack-rpc/tree/master/haskell">MessagePack-RPC for Haskell</a></h4>
<p>MessagePack-RPC implementation for Haskell</p>
<h4><a href="https://github.com/msgpack/msgpack-rpc-python">MessagePack-RPC for Python</a></h4>
<p>MessagePack-RPC implementation for Python</p>
-->
</div>
</div>
</div>
<footer id="footer">
<div id="footerbody" class="paragraphs">
<div id="social">
<!--
<iframe src="http://markdotto.github.com/github-buttons/github-btn.html?user=msgpack&type=follow"
allowtransparency="true" frameborder="0" scrolling="0" width="132px" height="20px"></iframe>
-->
<a href="https://twitter.com/share" class="twitter-share-button" data-hashtags="msgpack">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<div class="fb-like" data-href="http://msgpack.org/" data-send="false" data-layout="button_count" data-width="120" data-show-faces="false"></div>
</div>
<div id="thanks">
<p id="sponsor"><a href="http://treasure-data.com/?source=mp">Sponsored by Treasure Data, Inc. <img src="images/td-icon.png" width="20" height="20" /></a></p>
<p>Copyright © 2008-2012 FURUHASHI Sadayuki</p>
</div>
</div>
</footer>
</body>
</html>