json-syntax: High-performance JSON parser and encoder

[ bsd3, data, library ] [ Propose Tags ] [ Report a vulnerability ]

This library parses JSON into a Value type that is consistent with the ABNF described in RFC 7159. The parser is about six times faster than the parser that aeson provides. This parser is however, non-resumable, so if resumable parsing is important, aeson should be preferred.

This library does not include any functions or typeclasses to help users marshal Value to their application-specific data types. Such functions and typeclasses are outside the scope of this library. If anyone writes a library that offers users these conveniences open a issue so that the json-syntax documentation can point users to it.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.1.0, 0.1.2.0, 0.2.0.0, 0.2.1.0, 0.2.2.0, 0.2.3.0, 0.2.4.0, 0.2.5.0, 0.2.6.0, 0.2.6.1, 0.2.7.0, 0.2.7.1, 0.2.7.2 (info)
Change log CHANGELOG.md
Dependencies array-builder (>=0.1 && <0.2), array-chunks (>=0.1.3 && <0.2), base (>=4.15 && <5), bytebuild (>=0.3.10 && <0.4), byteslice (>=0.2.9 && <0.3), bytesmith (>=0.3.8 && <0.4), bytestring (>=0.10.8 && <0.12), contiguous (>=0.6 && <0.7), natural-arithmetic (>=0.1.2 && <0.3), primitive (>=0.7 && <0.10), run-st (>=0.1.1 && <0.2), scientific-notation (>=0.1.6 && <0.2), text (>=2.0.2 && <2.2), text-short (>=0.1.3 && <0.2), transformers (>=0.5.6 && <0.7), word-compat (>=0.0.6 && <0.1), zigzag (>=0.0.1 && <0.1) [details]
Tested with ghc ==9.4.8 || ==9.6.3 || ==9.8.1
License BSD-3-Clause
Copyright 2019 Andrew Martin
Author Andrew Martin
Maintainer amartin@layer3com.com
Category Data
Home page https://github.com/byteverse/json-syntax
Bug tracker https://github.com/byteverse/json-syntax/issues
Source repo head: git clone git://github.com/byteverse/json-syntax.git
Uploaded by l3c_amartin at 2024-02-07T16:28:18Z
Distributions
Reverse Dependencies 2 direct, 0 indirect [details]
Downloads 1579 total (31 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
All reported builds failed as of 2024-02-07 [all 1 reports]

Readme for json-syntax-0.2.7.2

[back to package description]

json-syntax

This library parses JSON into a Value type that is consistent with the ABNF described in RFC 7159. The parser is about six times faster than the parser that aeson provides. This parser is however, non-resumable, so if resumable parsing is important, aeson should be preferred. Results from the benchmark suite:

benchmarked json/twitter/100
time                 208.6 μs   (207.1 μs .. 210.1 μs)
                     1.000 R²   (0.999 R² .. 1.000 R²)
mean                 211.8 μs   (210.7 μs .. 213.3 μs)
std dev              4.493 μs   (3.299 μs .. 7.422 μs)

benchmarked aeson/twitter/100
time                 1.284 ms   (1.267 ms .. 1.296 ms)
                     0.999 R²   (0.999 R² .. 1.000 R²)
mean                 1.282 ms   (1.276 ms .. 1.292 ms)
std dev              26.07 μs   (17.87 μs .. 40.01 μs)

This library does not include any functions or typeclasses to help users convert data from Value, the RFC-7159-inspired syntax tree data type. Such functions and typeclasses are outside the scope of this library. If anyone writes a library that helps users marshal their data in this way, open a issue so that the json-syntax documentation can point users to it.