Live data from Hacker News

Dhall: A Non-Repetitive Alternative to YAML

dhall-lang.org

31–40 of 181 posts

Re: Dhall: A Non-Repetitive Alternative to YAML

#31
post #28

For a pragmatic, really readable configuration file format, TOML never disappointed me ( https://github.com/toml-lang/toml#user-content-local-date ). - This is human readable contrary to the JSON family and its {} abuses. - It is not space / ident base contrary to YAML that becomes very quickly a mess to write and a mess to parse.

TOML is almost perfect. The only things I don't like are the need for commas and the double brackets.

Re: Dhall: A Non-Repetitive Alternative to YAML

#32
post #29
post #26

Earlier quoted context omitted.

That’s about the least interesting thing about Dhall. (It’s weird that they tout it prominently on the homepage.) There are so many flavors of syntax sugar for JSON, Dhall is a completely different beast.

You might want to ask the HN admins to rename the title for this post, then.

It looks fine to me. Reducing repetition is precisely the type of thing Dhall’s features should be useful for.

Re: Dhall: A Non-Repetitive Alternative to YAML

#33
post #5
post #3

Earlier quoted context omitted.

Makes it easier when commenting out. Use this trick for SQL and JS too (to prevent trailing comma issue)

I don't get why you'd build a language in 2019 which disallows a trailing comma in lists.

Alternatively it could allow leading commas.

Re: Dhall: A Non-Repetitive Alternative to YAML

#34
post #22

To me, worrying about config files seems like the ultimate exercise in bikeshedding. You either need a simple list of items (eg. dependencies) or key/value pairs. Use a text file or yml or json or whatever. Or you need templating, the use of functions, etc, like dhall provides. But then, why not use the language you're already using for the rest of your project, or a bash script to export some variables? Might sound…

One reason is that "configuration language" is an extremely wide topic. Some configs use yaml to encode bash scripts for example. Overall a reason enough is that human-friendly languages have different priority than parser-friendly ones. Honestly it is the reason I like TOML, with the exception of the date data type it cleanly maps to json (which everyone agrees it is a good enough serialization format) and it is spe…

> Overall a reason enough is that human-friendly languages have different priority than parser-friendly ones.

Okay thanks, that's a good one. Readability might be a big deal.

Re: Dhall: A Non-Repetitive Alternative to YAML

#35
post #5
post #3

Earlier quoted context omitted.

Makes it easier when commenting out. Use this trick for SQL and JS too (to prevent trailing comma issue)

I don't get why you'd build a language in 2019 which disallows a trailing comma in lists.

On the other hand - why would you build a language where commas aren’t treated as whitespace?

Re: Dhall: A Non-Repetitive Alternative to YAML

#36
post #35
post #5

Earlier quoted context omitted.

I don't get why you'd build a language in 2019 which disallows a trailing comma in lists.

On the other hand - why would you build a language where commas aren’t treated as whitespace?

You could absolutely do this as well. I'm just taking issue with a language that constrains you in such a way that you have to put the commas at the beginning of the list elements, so it plays nicely with {comments, source control blame}.

Re: Dhall: A Non-Repetitive Alternative to YAML

#38
post #9

Earlier quoted context omitted.

Weird that it's billed as an alternative to YAML, but effectively has zero roots or influence from YAML. Looks more like an alternative to... whatever configuration language is popular in ML language projects?

So? They live in the same solution domain for the same problem. Moreover, Dhall can generate (typechecked) YAML and JSON.

It's not even in the same solution space. I can't replace my YAML with Dhall and consume it directly. I have to now depend on the converter to go from Dhall -> YAML/JSON. All I did was add another layer of complexity into my config.

Maybe you'll benefit from the added abstraction; I see the value in having "typed" configs that are semi-scriptable but not turing complete. But it's in no way a "replacement".

Re: Dhall: A Non-Repetitive Alternative to YAML

#39
post #10

Immediate response? I hate commas at the start of lines and I would prefer not to have curly braces in a human editable/readable format. Neither reason is terribly rational but my first impressions weren't great.

It looks that Dhall has been inspired of the Elm language [0] and it's formatter. [0]: https://guide.elm-lang.org/

It's a common practice in the Haskell community. Knowing where the creator of dhall comes from I would say that that's the source of inspiration
Post reply on HN