4 ms·
Show HN: Wrote a JSON parser from scratch in go
First time ever working on something like this, check it out
- itake 2y agoMight be useful to post performance stats
- KhushPatibandha 2y agoSure thing, I'll do it and probably put it in the readme at the end
- buttrpopcorn 2y agoJust out of curiosity, what was your motivation to make this?
- KhushPatibandha 2y agoI just started learning about parsers and compilers and json is probably the easiest thing to parse, also json is used everwhere and i have used it in pretty much every project so why not
- hgyjnbdet 2y agoCSV is easier.
- KhushPatibandha 2y agoi'll make that over this weekend
- hnkain 2y agoIt's great as a learning experience for the author, but it would be a good idea for the author to take a look at a JSON spec and see if the regular expressions used by the lexer support the whole spec and don't accept non-legal JSON. From a cursory glance, it seems like exponents in floating point numbers aren't supported, nor are escaped quotation marks in strings (`\"`). I think it supports string escapes that are valid in go, but not in JSON like `\xab` and 8-hexdigit unicode escapes `\U1234abcd`.
- KhushPatibandha 2y agoACK, i'll be adding stuff to this for sure. appreciate you for pointing that out thx