Skip to content

Use only the public API of JSON.jl, and remove playground/ - #17

Merged
rmsrosa merged 1 commit into
mainfrom
ccr-0c004460-kd2lly
Nov 19, 2026
Merged

rmsrosa merged 1 commit into
mainfrom
ccr-0c004460-kd2lly

Conversation

@rmsrosa

@rmsrosa rmsrosa commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Two clean-ups before registering the package.

Changes

  • Only the public API of JSON.jl. Reading numbers at full precision (fromjson into structs with a non-Float64 real type, e.g. BeerJSON{BigInt, BigFloat}) used four functions that JSON.jl does not declare public: applyobject, applyarray, gettype and JSONTypes. A minor JSON.jl release could change them. _jsparsebig now reads objects and arrays one level at a time as JSON.JSONText, using JSON.Object{String, JSONText} and Vector{JSONText}, and parses each value in turn. Numbers that are not integers go through JSON.parse(text, BigFloat). Key order is preserved.
    • Same output as before on all the BeerJSON samples read as BeerJSON{BigInt, BigFloat} (compared via tojson).
    • About 18% slower on that path only (Punk IPA: 705 → 836 µs). Reading into the default Float64 types is unchanged.
  • Removed playground/: two old exploratory scripts that used JSON3 and HTTP, which are not dependencies.

Checks

  • Pkg.test() passes on Julia 1.13 (487 tests) and 1.10 (485 tests), including the tests of full-precision reading.
  • Aqua.jl reports no issues; I ran it locally and did not add it to the tests.

Generated by Claude Code

- Reading numbers as `BigFloat` (`fromjson` into structs with a
  non-`Float64` real type) no longer uses internal functions of JSON.jl
  (`applyobject`, `applyarray`, `gettype`, `JSONTypes`): objects and
  arrays are read one level at a time as `JSONText`, and each value is
  parsed in turn. Same results on the BeerJSON samples.
- Remove the old exploratory scripts in `playground/`, which used
  packages that are not dependencies (JSON3, HTTP).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmsrosa
rmsrosa merged commit 0cf92bb into main Nov 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants