Abusing C to Implement JSON Parsing with Struct Methods

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

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
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
  1. foop

    C Framework for Object-Orientated Programming

    years ago i made a lib that tries to avoid the duplication in e.g. json->is_eof(json)

    https://github.com/montyanderson/foop

  2. 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
  3. dynamic

    Dynamically typed C objects (by 99991)

    You could tag dynamically allocated objects with some magic bytes. To check whether a string is dynamically allocated, you can simply check whether it starts with those magic bytes. This is a probabilistic method, but if you use enough magic bytes, it becomes basically impossible to go wrong.

    See e.g. https://github.com/99991/dynamic/blob/a423a04061ee44bad0720f... for an example (incidentally also a C JSON parser).

  4. json

    C++ header-only JSON library (by taocpp)

    Here's something like that I wrote in 2017 for JSON using Boost.Fusion + overload resolution of a single 'from_json' function for JSON parsing.

    https://gist.github.com/nlyan/045fbe075b4e51d83be0cf4513fecd...

    The DEFINE_JSON macro is a tiny wrapper around BOOST_FUSION_DEFINE_STRUCT

    https://www.boost.org/doc/libs/1_87_0/libs/fusion/doc/html/f...

    The code predates broad availability of std::optional and the existence of Boost.JSON, so if i were using this technique today that's what I'd use, but at the time I used taocpp (which is still actively maintained 8 years later)

    https://github.com/taocpp/json

  5. refl-cpp

    Static reflection for C++17 (compile-time enumeration, attributes, proxies, overloads, template functions, metaprogramming).

    It's definitively different than Frunk, the library is not a general-purpose functional toolkit. One could certainly implement it with Zig's compile-time reflection with ease (don't know much about D). Actually, it's superficially similar to refl-cpp's serialization example [1], but with far less templating magic underneath due to the restricted scope.

    [1] https://github.com/veselink1/refl-cpp/blob/master/examples/e...

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

  • C++ Reflection for Component Serialization and Inspection

    3 projects | /r/gameenginedevs | 4 Mar 2023
  • Compile-time JSON deserialization in C++

    4 projects | news.ycombinator.com | 9 Jul 2024
  • Out of bounds memory access in V8 in Google Chrome prior to 120.0.6099.224

    1 project | news.ycombinator.com | 25 Jan 2024
  • Sharing Saturday #472

    7 projects | /r/roguelikedev | 23 Jun 2023
  • Has Boost lost its charm?

    3 projects | /r/cpp | 27 Apr 2023

Did you know that C++ is
the 7th most popular programming language
based on number of references?