Comparison of data-serialization formats: Difference between revisions

Content deleted Content added
No edit summary
Tag: Reverted
m resize table font
 
(17 intermediate revisions by 10 users not shown)
Line 1:
{{Short description|None}}
This is a '''comparison of [[data serialization]] [[file format|format]]sformats''', various ways to convert complex [[object (computer science)|object]]s to sequences of [[bit]]s. It does not include [[markup language]]s used exclusively as [[document file format]]s.
 
==Overview==
 
<div style="overflow-x:auto;">
{{sort-under}}
{| class="wikitable sortable mw-collapsible"
{{sticky table start}}
{| class="wikitable sortable sort-under sticky-table-head" style="font-size:75%"
|-
! Name
Line 17 ⟶ 19:
! Standard [[API]]s
! Supports [[zero-copy]] operations
|-
| [[Apache Arrow]]
| [[Apache Software Foundation]]
| {{n/a}}
| {{partial|''De facto''}}
| [https://arrow.apache.org/docs/format/Columnar.html Arrow Columnar Format]
| {{yes}}
| {{no}}
| {{yes}}
| {{yes|Built-in}}
| C, C++, C#, Go, Java, JavaScript, Julia, Matlab, Python, R, Ruby, Rust, Swift
| {{yes}}
|-
| [[Apache Avro]]
Line 117 ⟶ 131:
| RFC author:<br>Yakov Shafranovich
| {{n/a}}
| {{partial|A myriad ofMyriad informal variants}}
| RFC 4180<br>(among others)
| {{no}}
Line 317 ⟶ 331:
| {{yes}}
| {{n/a}}
|-
| [[Pickle (Python)]]
| [[Guido van Rossum]]
| [[Python (programming language)|Python]]
| {{yes|''De facto'' as [[Python Enhancement Proposal|PEP]]s}}
| [https://www.python.org/dev/peps/pep-3154/ PEP 3154 – Pickle protocol version 4]
| {{yes}}
| {{no}}
| {{yes}}<ref>[https://github.com/python/cpython/blob/v3.9.0/Lib/pickle.py#L137-L144 cpython/Lib/pickle.py]</ref>
| {{no}}
| {{yes}}
| {{no}}
|-
| [[Property list]]
Line 462 ⟶ 488:
! Supports [[zero-copy]] operations
|}
{{sticky table end}}
</div>
 
{{ordered list
| list-style-type=lower-alpha
Line 476 ⟶ 503:
 
==Syntax comparison of human-readable formats==
 
<div style="overflow-x:auto;">
{{sticky table start}}
{| class="wikitable"
{| class="wikitable sortable sort-under sticky-table-head" style="font-size:75%"
|-
! Format
Line 544 ⟶ 572:
| <code>[true nil -42.1e7 "A to Z"]</code>
| <code>{:kw 1, "42" true, "A to Z" [1 2 3]}</code>
|-
! Format
! [[Nullable type|Null]]
! [[Boolean data type|Boolean]] true
! [[Boolean data type|Boolean]] false
! [[Integer (computer science)|Integer]]
! [[Floating-point]]
! [[String (computer science)|String]]
! [[Array data type|Array]]
! [[Associative array]]/[[Object (computer science)|Object]]
|-
| [[Ion (Serialization format)|Ion]]
Line 628 ⟶ 646:
true
"A to Z", (1, 2, 3)</pre>
|-
! Format
! [[Nullable type|Null]]
! [[Boolean data type|Boolean]] true
! [[Boolean data type|Boolean]] false
! [[Integer (computer science)|Integer]]
! [[Floating-point]]
! [[String (computer science)|String]]
! [[Array data type|Array]]
! [[Associative array]]/[[Object (computer science)|Object]]
|-
| [[OpenDDL]]
Line 754 ⟶ 762:
[extensionFieldThatIsAnEnum]: EnumValue
</syntaxhighlight>
|-
! Format
! [[Nullable type|Null]]
! [[Boolean data type|Boolean]] true
! [[Boolean data type|Boolean]] false
! [[Integer (computer science)|Integer]]
! [[Floating-point]]
! [[String (computer science)|String]]
! [[Array data type|Array]]
! [[Associative array]]/[[Object (computer science)|Object]]
|-
| [[S-expression]]s
Line 847 ⟶ 845:
</struct></syntaxhighlight>
|}
{{sticky table end}}
{{ordered list
| list-style-type=lower-alpha
Line 856 ⟶ 855:
| {{note|lispstd}}This syntax is not compatible with the Internet-Draft, but is used by some dialects of [[Lisp (programming language)|Lisp]].
}}
 
</div>
 
==Comparison of binary formats==
<!--This table is meant to describe how the various datatypes are encoded in binary in the various formats.-->
 
{| class="wikitable"
{{sticky table start}}
{| class="wikitable sortable sort-under sticky-table-head sticky-table-col1" style="font-size:75%"
|- style="vertical-align:bottom;"
! Format
Line 868 ⟶ 869:
! [[Floating-point]]
! [[String (computer science)|String]]
! [[Array (data type)|Array]]
! [[Associative array]]/[[object (computer science)|object]]
|- style="vertical-align:top;"
Line 1,019 ⟶ 1,020:
|- style="vertical-align:top;"
| [[Netstring]]s{{efn |group=binary |Interpretation of Netstrings is entirely application- or schema-dependent.}}
| {{No|Not in protocol.}}
| {{No|Not in protocol.}}
| {{No|Not in protocol.}}
Line 1,024 ⟶ 1,026:
| Length-encoded as an ASCII string + ':' + data + ','<br>
Length counts only octets between ':' and ','
| {{No|Not in protocol.}}
| {{No|Not in protocol.}}
| {{No|Not in protocol.}}
Line 1,096 ⟶ 1,097:
|
|}
 
{{sticky table end}}
{{notelist|group=binary}}
 
==See also==
*[[Comparison of document- markup languages]]
 
==References==