GithubHelp home page GithubHelp logo

Comments (2)

cerbero90 avatar cerbero90 commented on June 2, 2024 2

Hi Faizan and thanks for your interest :)

JSON Machine is a fantastic project and I contributed to it in the past by letting JSON pointers iterate through nested arrays and fixing some bugs.

However it's not fully OOP, it's hard to debug and extend, runs extra loops and regex, works on limited JSON sources and its pointers aren't 100% accurate.

Don't get me wrong, I'm a fan of Filip and his hard work, but the points mentioned above and the need of extra functionalities (not easily implementable in JSON Machine) led me to the decision of creating my own parser.

The main difference between the two projects is that JSON Parser is able to parse JSONs of any dimension because it leverages recursive generators, whilst JSON Machine would run out of memory if a value is too large.

For completeness, here is a comprehensive list of the benefits of JSON Parser compared to JSON Machine:

  • parsing of JSONs of any dimension thanks to recursive generators
  • support for more JSON sources by default
  • easy implementation of custom JSON sources to parse
  • easy implementation of custom decoders
  • ability to mix JSON pointers and lazy JSON pointers
  • definition of callbacks to handle each JSON pointer with its own custom logic
  • simple eager load of extracted sub-trees into array
  • improved and easier errors handling
  • ability to parse malformed JSONs and fix them on-the-fly
  • automatic recognition of JSON sources
  • single entry-point for an improved and simplified developer experience
  • support for the Simdison decoder
  • automatic detection of JSON dimension depending on the source
  • automatic progress tracking
  • fully customizable parsing through a fluent configuration
  • fully OOP: the code is much easier to read, maintain and extend
  • modern and shaped around PHP 8.1
  • fully typed and commented with IDE-friendly docblocks
  • PHPStan set to the max level to provide a complete static analysis
  • less nested loops, conditions and regular expressions
  • accurate and deeply tested JSON pointers
  • complete set of exceptions to provide all the needed info and data for debugging purposes

from json-parser.

faizanakram99 avatar faizanakram99 commented on June 2, 2024 2

Thank you for the detailed comparison

from json-parser.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.