2 ms·
Maybe? :) I haven’t tried. I did do this one actually in an afternoon: https://github.com/pangbox/rugburn/blob/master/src/json.c https://github.com/pangbox/ru
by jchw 5y ago
Maybe? :) I haven’t tried.
I did do this one actually in an afternoon:
https://github.com/pangbox/rugburn/blob/master/src/json.c https://github.com/pangbox/rugburn/blob/master/src/json.c
... but I will say that it is intentionally very limited in its API due to its intended use case and desired footprint. (And because it’s designed to compile with OpenWatcom 2 with no libc for only Win32, but those particular constraints are not very interesting for this.)
I would imagine if I did try, I would have a fighting chance at making something properly strict. But I admittedly don’t know how to handle recursion in a stackless manner.
Edit: specifically for C, it would be hard to do it properly unless I had access to an implementation of Clinger and Steele & White. Go would be easier since it has better floating point algorithms with strconv, but relying on C strtod/etc. is probably a bad idea due to variability. That having been said, maybe you could do Clinger in the same afternoon; I’d be worried about edge cases, but simply put, I haven’t tried.