postcard
cJSON
postcard | cJSON | |
---|---|---|
7 | 15 | |
708 | 10,049 | |
- | - | |
5.9 | 5.5 | |
12 days ago | about 16 hours ago | |
Rust | C | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
postcard
-
Best format for high-performance Serde?
I've been enjoying postcard as a lightweight efficient binary serialization.
-
Ractor: not just another actor framework
That said, postcard is not a self describing format (so everyone needs the same schema, no changes allowed), but I do have a tracking issue open for ways to handle this in the future.
-
Are there any serialization crates that do Varint encoding without Zigzag encoding?
For example, look at the Postcard serializer for inspiration.
-
Hey Rustaceans! Got a question? Ask here! (51/2022)!
Serde should be no_std, I have used it embedded with crates such as postcard. You can see how postcard disables default features of serde here : https://github.com/jamesmunns/postcard/blob/main/Cargo.toml
-
jemi: a compact JSON serializer for embedded systems
Another option that may work for some is SerDe on rust. You just write a struct with the fields you want #[derive(Serialize, Deserialize)] above it, and if codegens the functions to deserialize that struct from JSON and serialize it back. Example looks like this https://docs.rs/serde_json/latest/serde_json/#creating-json-by-serializing-data-structures (but you have to use serde-json-core if you don’t have an allocator). Can also easily reserialize to something small like postcard that’s meant for embedded storage.
-
Karmem: A fast binary serialization format faster than Google Flatbuffers
https://github.com/jamesmunns/postcard
postcard seems like it would be particularly strong for the wasm use case as it produces small messages that are light in memory.
cJSON
-
Botlib: Telegram Bots in C by Antirez
It’s a library he’s including directly. It’s the same.
https://github.com/DaveGamble/cJSON
- Made a web app (URL Shortener )in C
- l
-
A good C library to parse json data
a quick google search is always easier than a whole reddit post cJSON
-
jemi: a compact JSON serializer for embedded systems
This is quite similar to cJSON, although cJSON leans more towards dynamic memory allocation.
-
Is there a de facto standard JSON library for C?
If 'de-factoness' (urgh) was measured in GitHub stars, then https://github.com/DaveGamble/cJSON would win.
- cJSON can't parse strings with a zero character in it, because strings are zero terminated in this api. But doesn't that make it absolutely useless for production? Like, one /0 and my programs crashes/can't parse? Why can't it be escaped?
- CJSON – Ultralightweight JSON parser in ANSI C
-
Luau Goes Open-Source
You often end up with cases where you have to manually call the correct free function for the type you're using, again completely untyped - e.g. if I'm using both sentry and cjson, then my function will ook something like this:
-
A tiny json parser for study.
Nice how would you compare this to DaveGambles cJSON? https://github.com/DaveGamble/cJSON (which I what I currently use)
What are some alternatives?
tinycbor - Concise Binary Object Representation (CBOR) Library
json-c - https://github.com/json-c/json-c is the official code repository for json-c. See the wiki for release tarballs for download. API docs at http://json-c.github.io/json-c/
karmem - Karmem is a fast binary serialization format, faster than Google Flatbuffers and optimized for TinyGo and WASM.
Jansson - C library for encoding, decoding and manipulating JSON data
ractor - Rust actor framework
ArduinoJson - 📟 JSON library for Arduino and embedded C++. Simple and efficient.
json-maker - C library used to code JSON objects in null-terminated strings
JSMN - Jsmn is a world fastest JSON parser/tokenizer. This is the official repo replacing the old one at Bitbucket
speedy - A fast binary serialization framework
RapidJSON - A fast JSON parser/generator for C++ with both SAX/DOM style API
tiny-json - The tiny-json is a versatile and easy to use json parser in C suitable for embedded systems. It is fast, robust and portable.
JsonCpp - A C++ library for interacting with JSON.