bytecodealliance / javy

JS to WebAssembly toolchain
Apache License 2.0
2.3k stars 111 forks source link

Improve json support #651

Closed saulecabrera closed 6 months ago

saulecabrera commented 6 months ago

Description of the change

This commit introduces several improvements for JSON. Namely:

--

The usage of the more performant JSON functions (based on SIMD and serde_json) requires enabling the QuickJS JSON intrinsic (see the config.rs module). The reason behind this decision is to enable: a compliant JSON implementation that is optimized for the hotpath: if extra arguments are passed to either JSON.{parse,stringify}, the native parse/stringify functions will be invoked, keeping the standard functionality.

I believe that the best way to test this would be to run JSON 262 tests, to ensure that the implementation is fully compliant. However, this is not included in this PR. Such change is better packed on its own pull-request. I'll follow up with a change that includes a way to run JSON 262 tests.

Checklist