Parsing JSON in 500 lines of Rust

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

Stream - Scalable APIs for Chat, Feeds, Moderation, & Video.
Stream helps developers build engaging apps that scale to millions with performant and flexible Chat, Feeds, Moderation, and Video APIs and SDKs powered by a global edge network and enterprise-grade infrastructure.
getstream.io
featured
InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
  1. json

    Strongly typed JSON library for Rust (by serde-rs)

    I have to commend on the simplicity and clarity of thought in the write up. I could see what you were up to just by a skim through it (also thanks for the ready reference)!

    I'm pretty sure you'd already know of this, but once you've written your own version, it might help to compare and take notes from a popular, well-established, benchmarked library: https://github.com/serde-rs/json.

  2. Stream

    Stream - Scalable APIs for Chat, Feeds, Moderation, & Video. Stream helps developers build engaging apps that scale to millions with performant and flexible Chat, Feeds, Moderation, and Video APIs and SDKs powered by a global edge network and enterprise-grade infrastructure.

    Stream logo
  3. sonny-jim

    Yet another JSON library for rust

    I need to work on my rust JSON parser some more[0]. I intended it handle deeply nested (malicious) objects gracefully and with little memory allocations. It's also pretty fast.

    I had a goal of making it "async", so it could periodically yield for large input strings, but I'm not so sure it matters much.

    Currently the API is pretty impractical to use, because of the arena structure that is set up. It could be improved

    [0] https://github.com/conradludgate/sonny-jim

  4. criterion.rs

    Statistics-driven benchmarking library for Rust

    Regarding the 'sudo' issue: Doing a benchmark by just running an example executable is not really recommended because there's a ton of reasons why you might get differing performance.

    It's probably better to set up an actual benchmark using a crate like Criterion instead [0].

    [0] https://github.com/bheisler/criterion.rs

  5. iter.json

    ezpkg.io/iter.json

  6. ujson

    µjson - A fast and minimal JSON parser and transformer that works on unstructured JSON

  7. nom

    Rust parser combinator framework

    And on a related note, this project was for educational purposes, but if the author wants to do more parsing in Rust, there's the excellent `nom` crate [1], which provides a JSON parser as an example [2].

    It uses a very similar paradigm to what the author used in the article, and provides a lot of helper utilities. I used it to parse a (very, very small) subset of Markdown recently [3] and enjoyed the experience.

    [1] https://github.com/rust-bakery/nom

    [2] https://github.com/rust-bakery/nom/blob/main/examples/json.r...

    [3] https://git.sr.ht/~bsprague/logseq-to-linkwarden

  8. jsonparser

    JSON parser creating Rust objects in-memory. (by rectalogic)

    I changed it to use Cow, performance improved from 121.02 MB/s to 278.66 MB/s

    https://github.com/rectalogic/jsonparser

  9. InfluxDB

    InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.

    InfluxDB logo
  10. jsb

    Fast json <=> binary serializer library for C

    That sounds a little like what I came up with a little while back. My lib can stream JSON to/from my own compact binary format that is easy to traverse/emit in C:

    https://github.com/nwpierce/jsb/

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

  • Lelwel: A resilient LL(1) parser generator for Rust

    1 project | news.ycombinator.com | 12 Jul 2024
  • What is the state of the art for creating domain-specific languages (DSLs) with Rust?

    7 projects | /r/rust | 21 Jun 2023
  • Letlang — Roadblocks and how to overcome them - My programming language targeting Rust

    6 projects | /r/rust | 7 Jun 2023
  • Sneller Regex vs Ripgrep

    3 projects | news.ycombinator.com | 18 May 2023
  • Grmtools – Grammar and Parsing Libraries for Rust

    1 project | news.ycombinator.com | 5 May 2023

Did you know that Rust is
the 5th most popular programming language
based on number of references?