
Show HN: Jsong: faster than light streaming JSON parser and writer in C - garnetius
https://github.com/garnetius/Jsong
======
mabynogy
I'm very impressed by the high level of quality of your code. It's clear,
beautiful and looks extremely efficient at the same time.

For example, the way the feature detection is done with "#if HAVE(INT32)" or
"#if C(MSC)".

I learned a trick with Debruijn sequences to count bits here:
[https://github.com/garnetius/QUANTUM/quantum/bitops.h](https://github.com/garnetius/QUANTUM/quantum/bitops.h)

It could be useful for a bitmap memory allocator I'm working on.

~~~
garnetius
I'm flattered. Jsong definitely wouldn't be possible without QUANTUM.

I learned the trick that you mentioned from WebKit source:
[https://github.com/WebKit/webkit/blob/b387856b9e42476169271f...](https://github.com/WebKit/webkit/blob/b387856b9e42476169271fe2c1739d799f2f170c/Source/WTF/wtf/Platform.h#L43)

It's slightly different there though. I don't think that boolean definition
tests (as in `definied`) should be mixed with actual definition value: what if
we want to check if `USE_STUFF` is defined, and zero is among possible
definition values?

~~~
mabynogy
I submitted QUANTUM separately:

[https://news.ycombinator.com/item?id=15063359](https://news.ycombinator.com/item?id=15063359)

------
marcofatica
nice

