jemi: a compact JSON serializer for embedded systems

This page summarizes the projects mentioned and recommended in the original post on /r/embedded

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • tiny-json

    The tiny-json is a versatile and easy to use json parser in C suitable for embedded systems. It is fast, robust and portable.

  • FYI I've been using https://github.com/rafagafe/tiny-json for several years now.

  • jemi

    jemi: a compact, trusting, JSON serializer with static allocation in pure C for embedded systems

  • So I created jemi ("Json EMItter"): you use use jemi primitives to build up the JSON structure that you need, then call jemi_emit() to dump the resulting JSON string to the output of your choice.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • Jansson

    C library for encoding, decoding and manipulating JSON data

  • Context: I needed to emit rather complex compound JSON data for a C-based project I'm working on. I could do it all with sprintf(), but it got messy quickly. I looked at available libraries such as jansson and CCAN's json, but they both used malloc(), which isn't an option in my case.

  • json-maker

    C library used to code JSON objects in null-terminated strings

  • I use his serializer too: https://github.com/rafagafe/json-maker/tree/master/src

  • postcard

    A no_std + serde compatible message library for Rust

  • Another option that may work for some is SerDe on rust. You just write a struct with the fields you want #[derive(Serialize, Deserialize)] above it, and if codegens the functions to deserialize that struct from JSON and serialize it back. Example looks like this https://docs.rs/serde_json/latest/serde_json/#creating-json-by-serializing-data-structures (but you have to use serde-json-core if you don’t have an allocator). Can also easily reserialize to something small like postcard that’s meant for embedded storage.

  • cJSON

    Ultralightweight JSON parser in ANSI C

  • This is quite similar to cJSON, although cJSON leans more towards dynamic memory allocation.

  • tinycbor

    Concise Binary Object Representation (CBOR) Library

  • Check out tinyCBOR and NanoCBOR

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • NanoCBOR

    CBOR library aimed at heavily constrained devices

  • Check out tinyCBOR and NanoCBOR

  • JSMN

    Jsmn is a world fastest JSON parser/tokenizer. This is the official repo replacing the old one at Bitbucket

  • As mentioned here, it appears that tiny-json is a parser, not a serializer. If you're looking for parsers, I've been very happy with jsmn.

  • zcbor

    Low footprint C/C++ CBOR library and Python tool providing code generation from CDDL descriptions.

  • Tinycbor is quite messy since you need one var for each map, element and level, for no reason. I ported all my cbor code to zcbor which is a lot cleaner.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts