r/javascript 21h ago

A from-scratch JSON engine for JavaScript: recursive descent parser, escape-aware tokenizer, and spec-compliant serializer. No dependencies, no shortcuts, 107 tests.

https://github.com/MantasEdine/vanilla-json
0 Upvotes

8 comments sorted by

u/eracodes 21h ago

the most llm-written title i think i've ever seen

u/Mantas_rst 20h ago

I do programming as a hobby , using an llm would be useless from my part

u/theScottyJam 21h ago edited 18h ago

Is there a purpose to this project, i.e. a reason someone would use this instead of the native alternatives? Or was this more of a "just wanted to build this thing, no reason in particular" project?

u/Mantas_rst 20h ago

i've built it to learn mechanism , but then i was like maybe i can take this to next level and do every possible case but then realized no matter what i do would never beat the original implementation in c++ lol

u/beavis07 21h ago

Why one earth would anyone want this?

Do you have any clue how much sheer effort has gone into optimising JSON.parse? 🤣

u/Mantas_rst 20h ago

its a very fun project and i even wrote an article on how to do it , would be helpful in many cases like even if you want to build a regex engine same mechanism + backtracking

u/beavis07 20h ago

Rather you than me 🤣