Skip to content

Feature Request: Supporting non-standard "relaxed" JSON syntaxes #2540

Closed

Description

@aylindmello

Is your feature request related to a problem? Please describe.

Hi, I noticed that non-standard “relaxed” JSON is not currently supported in simdjson. For example, Infinity/NaN number literals, C-style comments, and trailing commas in JSON files.

I am considering moving to simdjson from rapidjson, so I would like to know whether the simdjson project is open to accepting pull requests enabling these relaxed JSON syntaxes.

Describe the solution you'd like

These "relaxed" JSON syntaxes should be gated by a (possibly build-time?) flag to avoid reducing performance for users with standards-conformant JSON files.

Additional context

I saw a few GitHub issues about this: #1540 #2347 #2414

Based on the comments in these issues, it seems like you are likely to accept well-written PRs enabling non-standard "relaxed" JSON syntax. But I just wanted to double-check before writing any code.

Activity

  1. Nelson-numerical-software commented on Nov 7, 2025

    @Nelson-numerical-software

    Just my two cents: "it’d be great if all the tricky edge cases were handled and the code could be reused as-is.
    For example for Nelson, which has the same built-in jsondecode as MATLAB already with simdjson."
    https://github.com/nelson-lang/nelson/blob/master/modules/json/src/cpp/JsonDecode.cpp

  2. lemire commented on Nov 7, 2025

    @lemire
    Member

    Based on the comments in these issues, it seems like you are likely to accept well-written PRs enabling non-standard "relaxed" JSON syntax. But I just wanted to double-check before writing any code.

    The simdjson library is a community-based project. Hence my answer: If you (or a colleague) want to implement this feature as an optional (disabled by default) feature, then it is likely we will accept it if it is well done. #1540 (comment)

    Elsewhere, I elaborated further:

    1. This should come at no performance (or memory) cost to users who do not need this feature.
    2. It should be well tested.
    3. It should be well documented.
    4. It should not inconvenience users who do not need this feature.

    Infinity/NaN number literals

    You can already support your own number types and we have an open issue for builtin support for extended value.

    trailing commas in JSON files.

    We support streams of comma-separated JSON documents at high speed:
    https://github.com/simdjson/simdjson/blob/master/doc/iterate_many.md

  3. lemire commented on Sep 22, 2026

    @lemire
    Member

    Closing as answered. To summarize:

    • Infinity/-Infinity/NaN literals are supported as an opt-in with SIMDJSON_ENABLE_NAN_INF (see Infinity and NaN support); this is on master and will ship in the next release.
    • For comments and trailing commas, we'd consider a PR that is disabled by default, costs nothing in performance or memory for users who don't enable it, and is well tested and documented.

    Feel free to open a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions