Skip to content

A very simple Json Parser I built while tinkering. Not for production. Tested on large json ~85MBps parsing on a M3 Mac single core.

Notifications You must be signed in to change notification settings

sandeshbhusal/JSONParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON parser

This is a very small-ish example of a relatively simple JSON parser that parses a given json input. Currently tested on a M3 Macbook Air, it parses a 25MB large json file in ~0.3 seconds on repeat benchmarks (maybe because of hot fs, haven't benchmarked that aspect yet).

Not for production use. Implemented:

  • Custom lexer
  • Custom recursive-descent parser with some lookahead (to prevent left-recursion, the parser looks ahead on a token to determine what the next output should be)

If you look at the commit history, you'll find all sorts of wacky stuff - from a LISP repl calculator, to a small implementation of a PL I was working on -- grammar using the Chumsky crate in Rust. However, the focus on that project has since moved to the Datamod project; I am not sure if Datamod is going to implement a DSL or run a embedded WASM subsystem, but my focus has since shifted on this project to just implement a JSON parser to see if I could.

Enjoy!

About

A very simple Json Parser I built while tinkering. Not for production. Tested on large json ~85MBps parsing on a M3 Mac single core.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages