Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Wrote a JSON parser from scratch in go (github.com/khushpatibandha)
22 points by KhushPatibandha 12 months ago | hide | past | favorite | 8 comments
First time ever working on something like this, check it out



It'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`.


ACK, i'll be adding stuff to this for sure. appreciate you for pointing that out thx


Might be useful to post performance stats


Sure thing, I'll do it and probably put it in the readme at the end


Just out of curiosity, what was your motivation to make this?


I 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


CSV is easier.


i'll make that over this weekend




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: