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

Ott support for JSON? #74

Open
martinberger opened this issue Jan 30, 2021 · 1 comment
Open

Ott support for JSON? #74

martinberger opened this issue Jan 30, 2021 · 1 comment

Comments

@martinberger
Copy link

martinberger commented Jan 30, 2021

JSON has emerged as a standard format for data types serialisation, and most programming languages now have strong JSON support. For example Ocaml can auto-generate JSON pretty-printers and parsers for data types using yojson or adt. Both tools require compile-time meta-programming (e.g. in the form of @@deriving) for auto-generation of suitable pretty-printers and parsers.

How hard would it be to add support for automatic generation of support for JSON to OCaml types? Given that Ott has full control over the output, I imagine that it could be straightforward, with the possible exception of cases where the autogenerated code needs to be overridden with existing pretty-printers or parsers. (I'm asking because I want to JSON-ify Jib (the Sail IR) and I'm struggling to do this in a principled way. A similar question could be asked about Lem, but Jib is specified in Ott.)

@PeterSewell
Copy link
Contributor

PeterSewell commented Jan 30, 2021 via email

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

No branches or pull requests

2 participants