Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON implementation #474

Open
srush opened this issue Jan 20, 2021 · 2 comments
Open

JSON implementation #474

srush opened this issue Jan 20, 2021 · 2 comments
Labels
libraries Libraries written in Dex

Comments

@srush
Copy link
Contributor

srush commented Jan 20, 2021

A json implementation (even write-only) would be useful and allow for more shiny demos.

This seems like a good template, but maybe needs associative maps (#343):
https://hackage.haskell.org/package/aeson-0.11.3.0/docs/Data-Aeson-Types.html

Some ideas:

These overlap a bit with Dex libs, but there was a lot of thought put into things like Vega, not sure it is necessary to rewrite from scratch.

@oxinabox
Copy link
Contributor

It might need associative maps, but it probably wouldn't need hashmaps.
(I should finish #343 at some point though).
Since JSON tends to have small number of keys, and technically speaking one is supposed to preserve order.
So a list-backed dictionary would be fine.

API-wise: It would be really nice if we had something that was like Show but was parameterized by MIMEtype and value type.
(which is what julia's show is).
Then we would define a method for the MIMEtype application/json.
Which could for simple types fallback to a generic method that is like show, and for dictionaries and other types
(this is a not at all subtle request for multiple-dispatch / multi-parameter type classes)

@srush
Copy link
Contributor Author

srush commented Jan 21, 2021

That's helpful thanks @oxinabox .

I now realize this probably needs recursive ADTs to do nicely. Although maybe I'll try a JSONShow approach for fun.

@dan-zheng dan-zheng added the libraries Libraries written in Dex label Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libraries Libraries written in Dex
Projects
None yet
Development

No branches or pull requests

3 participants