Re:Show HN: A Fast, Malloc-Free C++14 Json Parser and Encoder
by areop on Friday November 14, 2014 @03:14PM
(#8609236)
I wrote a JSON-Parser in C with minimal validation in ~250 LOC that does not allocate memory, but leaves the type check and conversion to the user.
https://github.com/vurtun/json
[ Parent
| on HN ]
Re:Show HN: A Fast, Malloc-Free C++14 Json Parser and Encoder
by jeremie on Friday November 14, 2014 @11:35PM
(#8610831)
It would be nice if the README mentioned it was originally based on my https://github.com/quartzjer/js0n :)
Re:Show HN: A Fast, Malloc-Free C++14 Json Parser and Encoder
by areop on Saturday November 15, 2014 @06:42AM
(#8611484)
Added your project as a reference. Sorry for the missing reference I originally never planned to make the project known publicly and therefore never added the references.
Re:Show HN: A Fast, Malloc-Free C++14 Json Parser and Encoder
by klibertp on Friday November 14, 2014 @06:57PM
(#8610267)
This is absolutely beautiful. I didn't know you could get an address of a label in C or to do a goto to an address from variable instead of a literal label. Is this new in C, or was it always there?
Re:Show HN: A Fast, Malloc-Free C++14 Json Parser and Encoder
by dietrichepp on Friday November 14, 2014 @07:01PM
(#8610282)
It's a GCC extension. https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
Re:Show HN: A Fast, Malloc-Free C++14 Json Parser and Encoder
by techdragon on Friday November 14, 2014 @08:45PM
(#8610545)
Is there an equivalent for Clang/LLVM?
Re:Show HN: A Fast, Malloc-Free C++14 Json Parser and Encoder
by cjcole on Friday November 14, 2014 @11:37PM
(#8610836)
Yes.
http://blog.llvm.org/2010/01/address-of-label-and-indirect-b...
A venerable interpreter implementation trick.
Re:Show HN: A Fast, Malloc-Free C++14 Json Parser and Encoder
by codehero on Friday November 14, 2014 @09:10PM
(#8610619)
Unfortunately it won't port to IAR, which is a shame. I don't understand why pointers to labels never made it to the C spec; it's one of the (equivaling) features that actually makes assembler look elegant.
Re:Show HN: A Fast, Malloc-Free C++14 Json Parser and Encoder
by rxi on Friday November 14, 2014 @06:58PM
(#8610274)
That test.c file looks familiar!
Re:Show HN: A Fast, Malloc-Free C++14 Json Parser and Encoder
by areop on Saturday November 15, 2014 @06:38AM
(#8611479)
Yeah I was looking for unit test macros and found your project. I added your project as a reference in the README for clarification of the origin.
Re:Show HN: A Fast, Malloc-Free C++14 Json Parser and Encoder
by huhtenberg on Friday November 14, 2014 @04:59PM
(#8609758)
That's a very nice code.