Show HN: 106-byte JSON field extractor for embedded (8× smaller than JSMN)

Share This Post

Single-header JSON field extractor for when you control both message format and receiver. 106 bytes on ARM Cortex-M4, no malloc, MIT licensed.

#include “packet_atoms.h”
char temp[16];
jet(“{“temp”:22.5,”hum”:65}”, “temp”, temp, sizeof(temp));
// temp now holds “22.5”

Deliberate limitations:
– Fixed field order (uses strstr)
– No nested objects/arrays
– Strings include quotes
– You design the protocol

Size comparison (ARM -Os):
– cJSON: 3.2 kB + malloc
– JSMN: 800 B + token iteration
– This: 106 B

Tested on Cortex-M4 and x86-64. Header-only, copy-paste ready.


Comments URL: https://news.ycombinator.com/item?id=45648471

Points: 1

# Comments: 0

Source: github.com

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore

Do You Want To Boost Your Business?

drop us a line and keep in touch

We are here to help

One of our technicians will be with you shortly.