Request for comments: JSON Sampling output

I would like to request comments on my proposal to add JSON as an option to output sampling results, primarly to Cmdstan.

Anyone interested in this topic please see the pull request on the design-doc repository: https://github.com/stan-dev/design-docs/pull/14

3 Likes

Maybe this could be useful for rstan and cmdstanr developers

Thanks @fabio for this!

Simdjson is supposed to be one of the quickest JSON libraries out there so its nice seing we now have a R wrapper on CRAN. Will give it a try if the wrapper is efficient we might switch to that in cmdstanr.

EDIT: the only downside I see is they expect c++17 suitable compiler which probably means we have to wait a bit for Rtools 4.0 to come out officialy at least.

1 Like

That would read JSON into R. What’s that used for? Isn’t CmdStan going to need JSON on disk to read?

I then saw that rcppsimdjson doesnt currently support writing, but if they ever extend to writing, that might be used for writing the R data to a data file used for sampling.

cmdstanr will use JSON for the data file. It was already using it previously, but we have temporarily switched back to Rdump because of the multi dimensional zero sized arrays issue with JSON in cmdstan. that has since been squashed. It will again use JSON once With Cmdstan 2.22+ use JSON by default by rok-cesnovar · Pull Request #110 · stan-dev/cmdstanr · GitHub is merged. We are currently using jsonlite but if this package would look promising we might think abou switching.

Given that simdjson is supposed to be the fastest C++ JSON library its definitely promising.