Puneet Varma (Editor)

Smile (data interchange format)

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Filename extension
  
.sml

Extended from
  
JSON

Type of format
  
Data interchange

Standard
  
no RFC yet

Internet media type
  
application/x-jackson-smile (proposed)

Website
  
wiki.fasterxml.com/SmileFormatSpec

Smile is a computer data interchange format based on JSON. It can also be considered as a binary serialization of generic JSON data model, which means that tools that operate on JSON may be used with Smile as well, as long as proper encoder/decoder exists for tool to use. The name comes from first 2 bytes of the 4 byte header, which consist of Smiley ":)" followed by a linefeed: choice made to make it easier to recognize Smile-encoded data files using textual command-line tools.

Contents

Efficiency

Compared to JSON, Smile is both more compact and more efficient to process (both to read and write). Part of this is due to more efficient binary encoding (similar to BSON, CBOR and UBJSON), 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 (64 bytes or less) String values with 1- or 2-byte reference ids.

Implementations

Libraries known to support Smile include:

  • Cheshire (Clojure) is a data encoding library that supports Smile as binary alternative to JSON
  • Jackson (Java) (with Smile dataformat module)
  • libsmile (C/C++; wrappers for Ruby, Perl)
  • Protostuff (Java) supports multiple data formats for serialization, including Smile, JSON, XML and Protobuf.
  • PySmile for encoding/decoding Smile data in Python
  • smile-js for decoding Smile data from Javascript
  • References

    Smile (data interchange format) Wikipedia


    Similar Topics