Live data from Hacker News

Dhall: A Non-Repetitive Alternative to YAML

dhall-lang.org

41–50 of 181 posts

Re: Dhall: A Non-Repetitive Alternative to YAML

#41
post #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.

Perfection is a bugaboo. Give me 95%, minor inconveniences, and declare vict'ry, say I.

Re: Dhall: A Non-Repetitive Alternative to YAML

#42
post #19

Hmm... So the authors claim that their language is guaranteed to terminate for all well-typed programs. That is actually a nice spot for configuration languages. Yet, I wonder how a) they guarantee it, as I have seen no obvious link to the language's semantics b) useful this is in practice. Nevertheless, very nice approach, indeed.

There is no support for recursion and the usual workarounds don't apply, so the language is not Turing complete: https://github.com/dhall-lang/dhall-lang/wiki/Safety-guarant...

Re: Dhall: A Non-Repetitive Alternative to YAML

#43
post #15
post #7

Earlier quoted context omitted.

Dhall heavily borrows both ideas and syntax from the ML family of languages. E.g. Haskell, OCaml, Elm, Purescript Colons are used for type signatures. Commas are presumably required because you can have multi line and nested records. (don't quote me on this, not a parser expert) The comment syntax is from Haskell. Not saying this syntax is familiar to everyone , but it is familiar to some. The lineage of the syntax m…

Yeah, but how is this relevant? YAML, for example, makes JSON a subset, which lets it consume existing JSON without any need for conversion. It's easy to learn, and readable. Leading commas are eyesores. Plus, not everybody is a fan of ML! These are not mass market languages.

Seems like you're criticizing it just because it's different from what you're used to.

Re: Dhall: A Non-Repetitive Alternative to YAML

#44
post #38

Earlier quoted context omitted.

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".

> All I did was add another layer of complexity

If that was in fact all you had done, it would not be worth it. But it might remove a ton of boilerplate from your YAML.

Re: Dhall: A Non-Repetitive Alternative to YAML

#46
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.

> commas at the start of lines

are not a requirement.

Re: Dhall: A Non-Repetitive Alternative to YAML

#47
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.

Dhall does not disallow trailing commas, nor require leading ones.

Re: Dhall: A Non-Repetitive Alternative to YAML

#50
post #15
post #7

Earlier quoted context omitted.

Dhall heavily borrows both ideas and syntax from the ML family of languages. E.g. Haskell, OCaml, Elm, Purescript Colons are used for type signatures. Commas are presumably required because you can have multi line and nested records. (don't quote me on this, not a parser expert) The comment syntax is from Haskell. Not saying this syntax is familiar to everyone , but it is familiar to some. The lineage of the syntax m…

Yeah, but how is this relevant? YAML, for example, makes JSON a subset, which lets it consume existing JSON without any need for conversion. It's easy to learn, and readable. Leading commas are eyesores. Plus, not everybody is a fan of ML! These are not mass market languages.

Not everybody’s a fan of C++, yet still...

YAML has its detractors and many of the criticisms against it are valid. It’s ambiguous and confusing and deeply nested significant white space, with odd indentation rules and optional syntax, is incredibly hard to follow as a human.

Post reply on HN