Replacement for JSON in Elm

Hi there :slight_smile:

I read this and wrote that

I suggest to discuss the whole thing here and using the Github issue itself for concrete stuff. Or however you want :sunny:

Happy to read your comments.

So you are suggesting something like elm.dhall instead of elm.json?

1 Like

The two articles are targeting different use cases.

One is for Data interchange (machine to machine), another is configuration (human to machine + human to human).

The confusion may come from the fact that JSON is used in all four cases (machine to machine, machine to human, human to machine and sometimes human to human)

For configuration file it is a trade-off between writ-ability (human to machine) verses readability (human to human). Configuration has reasons to be complex, as in the case of the nix package manager. But for Elm the Dhall format IMO is too complex for a rather simple configuration.
The only significant downsides that I see regarding using JSON as configuration is the lack of comments. Comments are quite crucial for a proper description of configuration to others or future self. Iā€™d suggest TOML to improve configuration experience over JSON for the comments and better readability, but the benefit seems too little compared with the comparability break.

2 Likes

I am very well aware about the difference. When you read Evans article, he is criticising JSON in general and I think its sane to adopt one language, ideally Elm itself to replace JSON overall. I just picked elm.json since it seems the most simple to replace just right know, to get one foot into the door. You know, just like Elm gets introduced into a lot of JavaScript shops.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.