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

Is there a specification for dhall-to-{json,yaml} and {json,yaml}-to-dhall? #2594

Open
winitzki opened this issue Jun 11, 2024 · 1 comment

Comments

@winitzki
Copy link
Collaborator

As part of my study of programming language theory, I have recently implemented a Dhall interpreter in Scala, which was a great experience because the Dhall language is so well documented and there is a standard test suite. My project is here https://github.com/winitzki/scall

Now I would like to be able to implement also the converters from Dhall to json/yaml and back. Where do I begin? Is there some specification or documentation about how Dhall expressions are converted to json/yaml and back? Is there a standard test suite that exercises all options?

@Gabriella439
Copy link
Collaborator

The conversion between JSON and YAML is not part of the Dhall standard. In fact, the standard doesn't actually specify anything about how Dhall expressions are converted to any file format, with one caveat: the standard does provide utilities in the Prelude specifically designed for use with some of the (non-standard) Dhall conversion utilities (e.g. dhall-to-json).

All of the logic for the Dhall conversions to and from JSON and YAML resides in the dhall-haskell repository, specifically in the dhall-json and dhall-yaml subprojects. Those subprojects also have test suites although they're nowhere near as comprehensive as the standard test suite.

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