Live data from Hacker News

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

github.com

91–100 of 248 posts

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

#91
post #12

JSON parser libraries in general is a black hole of suffering imo. They're either written with a different use case in mind, or a complex mess of abstractions; often both. It's not a very difficult problem to solve if you only write exactly what you need for your specific use case.

Anyone who claims "it's not a very difficult problem" hasn't actually had to solve that problem.

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

#93
Neat! Might look at this next time I need a JSON parser in C.

I've been using cJSON[0] for years now and am pretty happy with it. I had used wjelement[1] before that but ran into a few issues and eventually moved away from it (can't recall why exactly its been so long.)

[0] https://github.com/DaveGamble/cJSON [1] https://github.com/netmail-open/wjelement

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

#95
I really enjoy these simple libraries, even though they are too flawed to be used for anything serious. There's great freedom in just drilling down to the basics, ignoring all the complexities, and just writing code that'll probably work most of the time.

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

#96
post #51

Earlier quoted context omitted.

> Hobby projects that prove useful have a tendency of starting to be used in production code Even if that is true, how is that the authors problem? The license clearly states that they're not responsible for damages. If you were developing such a serious project then you need the appropriate vetting process and/or support contracts for your dependencies.

I didn’t say it’s the author’s problem. It’s a problem with the code.

Why play all these semantic games? You're saying it's the author's problem. You want them to even edit their readme to include warnings for would be production/business users who don't want to pay for it.

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

#97
post #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 lightwe…

It's open source, not free software.

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

#98
This is rather lenient. There's not anything wrong with that (although perhaps it should be noted for people that will use it without looking at the code), but it's the main reason this can be so small. Using their demo in the readme:

    {"x",10eee"y"22:5,{[:::,,}]"w"7"h"33
    rect: { 10, 22, 7, 33 }

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

#99
post #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 lightwe…

It's open source, not free software.

The license says otherwise; hard to get freer than public domain.

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

#100
post #12

JSON parser libraries in general is a black hole of suffering imo. They're either written with a different use case in mind, or a complex mess of abstractions; often both. It's not a very difficult problem to solve if you only write exactly what you need for your specific use case.

> JSON parser libraries in general is a black hole of suffering imo.

Sexprs sitting over here, hoping for some love.

Post reply on HN