Live data from Hacker News

Sj.h: A tiny little JSON parsing library in ~150 lines of C99

github.com

1–10 of 248 posts

Re: Sj.h: A tiny little JSON parsing library in ~150 lines of C99

#6
post #3

What’s the usecase for something like this? There are lots of excellent libraries for json available. Is this a teaching tool?

Small code is easier to review, so projects with strict security requirements might be one?

Also, license compliance is very easy (no notice required).

Re: Sj.h: A tiny little JSON parsing library in ~150 lines of C99

#8
What I love about this author's work is that they're usually single-file libraries in ANSI C or Lua with focused scope, easy-to-use interface, and good documentation. And free software license. Aside from the posted project, some I like are:

- log.c - A simple logging library implemented in C99

- microui - A tiny immediate-mode UI library

- fe - A tiny, embeddable language implemented in ANSI C

- microtar - A lightweight tar library written in ANSI C

- cembed - A small utility for embedding files in a C header

- ini - A tiny ANSI C library for loading .ini config files

- json.lua - A lightweight JSON library for Lua

- lite - A lightweight text editor written in Lua

- cmixer - Portable ANSI C audio mixer for games

- uuid4 - A tiny C library for generating uuid4 strings

Re: Sj.h: A tiny little JSON parsing library in ~150 lines of C99

#10
post #2

This is interesting, but how does this do on the conformance tests? https://github.com/nst/JSONTestSuite

Real question, does it manage nested objects ?

It seems so: https://github.com/rxi/sj.h/blob/master/demo%2Fobject.c
Post reply on HN