JSON with Commas and Comments

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

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

    JSON5 — JSON for Humans

  • msgpack-tools

    Command-line tools for converting between MessagePack and JSON / msgpack.org[UNIX Shell]

  • I wholeheartedly agree with this idea. In case anyone wants a fast C++ parser for this, RapidJSON [1] has optional support for comments and trailing commas; I actually added trailing comma support to it.

    I did this to support hand-writing game data in JSON (e.g. monster stats, campaign dialog scripts) and then converting it to MessagePack at build time [2]. This gives you very high simplicity (e.g. no schemas) and excellent performance.

    [1] http://rapidjson.org/

    [2] https://github.com/ludocode/msgpack-tools

  • 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
  • ujsonin

    Micro JSON Input / Reader

  • Been there, done that: https://github.com/nanoscopic/ujsonin

    "JSON" parser in both C, Perl, and Golang. All three support "JSON" with or without commas as you desire and comments.

  • awesome-json-next

    A Collection of What's Next for Awesome JSON (JavaScript Object Notation) for Structured (Meta) Data in Text - JSON5, HJSON, HanSON, TJSON, SON, CSON, USON, JSONX/JSON11 & Many More

  • FYI: I collect JSON variants with extension at the Awesome JSON - What's Next? page [1].

    [1] https://github.com/json-next/awesome-json-next

  • asn1c

    The ASN.1 Compiler

  • I've used ASN.1 at work quite a bit, and the reason you won't see it much are pretty much:

    - HORRIBLE schema format.

    - Very few FOSS libraries, most of which are terrible. I used Lev Walkins asn1c[0], which I patched slightly and coupled with some semi-generic code to emit JSON (for debugging purposes).

    [0] https://github.com/vlm/asn1c

  • tools

    Discontinued Unified developer tools for JavaScript, TypeScript, and the web

  • Looks pretty similar to rome json (https://rome.tools/#rome-json)

  • pbc

    Discontinued A protocol buffers library for C

  • There are protobuf libraries without code generation, for instance: https://github.com/cloudwu/pbc

  • 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
  • ruby-skyjam

    A Google Music client gem

  • I found code generation to be useful in Ruby with protobuf. This:

    https://github.com/lloeki/ruby-skyjam/blob/master/defs/skyja...

    gives that:

    https://github.com/lloeki/ruby-skyjam/blob/master/lib/skyjam...

    I would certainly enjoy having a DSL to write descriptive code to validate using JSON schema, but it would be even better if the Ruby definitions could be generated and persisted in Ruby files using that DSL.

    Also, storing things in basic hash/array types works, but having dedicated types is useful, so that one can ensure not shoving one kind of hash in place of another unrelated kind of hash.

    As for types themselves in general, there's RBS and Sorbet. One could have type definition generation as well for even deeper static and runtime checks.

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