Skip to content

Memory-safe Rust implementation of cJSON with drop-in C ABI #1020

@ThomasJenkinson

Description

@ThomasJenkinson

Hi Dave, Max, Alan and the cJSON community,

We've built a clean-room Rust implementation of libcjson that provides a drop-in C ABI replacement. The goal is to let projects currently using cJSON swap in a memory-safe implementation without changing any downstream code.

The implementation covers the full cJSON API surface, is tested against cJSON's own test cases and examples, and ships as a shared library with the same header interface.

Repo: https://github.com/ThomasJenkinson/cjson-rs

This is part of a broader effort at Gordion-Solutions to build memory-safe replacements for widely used C libraries using the same methodology. We've applied the same approach to memcached, mcrouter, and are currently halfway through a replacement for libexpat.

We wanted to share this with you out of respect for the project. cJSON's simplicity and clarity made it an excellent candidate for this kind of work. We'd welcome any feedback from the maintainers or the community.

Thanks for building and maintaining cJSON — it's a genuinely useful piece of infrastructure.

Kind Regards,
thomas@huloco.com
Gordion-Solutions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions