Smile (data interchange format)
Smile is a computer data interchange format based on JSON. It can also be considered a binary serialization of the generic JSON data model, which means tools that operate on JSON may be used with Smile as well, as long as a proper encoder/decoder exists for the tool.
The name comes from the first 2 bytes of the 4 byte header, which consist of Smiley ":)" followed by a linefeed: a choice made to make it easier to recognize Smile-encoded data files using textual command-line tools.
Efficiency
Compared to JSON, Smile is both more compact and more efficient to process.Part of this is due to more efficient binary encoding, but an additional feature is optional use of back references for property names and values.
Back referencing allows replacing of property names and/or short String values with 1- or 2-byte reference ids.
Implementations
Libraries known to support Smile include:- is a data encoding library that supports Smile as binary alternative to JSON
- Jackson with supporting Smile, Avro, CBOR, Ion and Protocol Buffers
- for beam languages, Erlang, Elixir, and Gleam
- for decoding Smile data in Golang
- supports multiple data formats for serialization, including Smile, JSON, XML and Protocol Buffers.
- for encoding/decoding Smile data in Python
- for encoding/decoding Smile data in Python >= 3.7
- for decoding Smile data from JavaScript
- for encoding/decoding data from Rust
Usage
- Elasticsearch supports Smile with its APIs