Live data from Hacker News

Dhall: A Non-Repetitive Alternative to YAML

dhall-lang.org

21–30 of 181 posts

Re: Dhall: A Non-Repetitive Alternative to YAML

#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 specifically focused on human friendliness (except uniform lists) and readability

As an underappreciated feature, the ability to have scoped keyvalues allow to define nested table with flat statements.

Re: Dhall: A Non-Repetitive Alternative to YAML

#23
post #9
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…

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?

There aren't too many standard onrs. Most people seem to either write a custom (embedded) DSL for their tool or go with something more widely known.

If people are curious about examples of DSLs in Haskell projects, they can look at cabal files, persistent's entity syntax, and servant's type level DSL for API definitions. These go on a scale from "fully separate" to "embedded in the language". (Persistent is in between, it uses something called Template Haskell)

The stack Haskell build/project management tool uses YAML files.

- - -

I think Dhall's power is not that it is an alternative syntax to YAML. It's more about the typesystem than anything else. If you're sold on types, then Dhall is definitely worth a look

Re: Dhall: A Non-Repetitive Alternative to YAML

#24
post #9
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…

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.

Re: Dhall: A Non-Repetitive Alternative to YAML

#26
post #12

Earlier quoted context omitted.

How is this at all related to Dhall? It looks like a completely different thing with a completely different purpose.

They are both text based configuration file formats made to be easier for humans to interact with, so I'm not sure what you're confused about?

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.

Re: Dhall: A Non-Repetitive Alternative to YAML

#27
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/

Re: Dhall: A Non-Repetitive Alternative to YAML

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

Re: Dhall: A Non-Repetitive Alternative to YAML

#29
post #26

Earlier quoted context omitted.

They are both text based configuration file formats made to be easier for humans to interact with, so I'm not sure what you're confused about?

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.

Re: Dhall: A Non-Repetitive Alternative to YAML

#30
post #16
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?

Its more like an alternative to scripts generating configuration from templates. they claim that this is better because you cant for example write an infinite loop ruining the script.

Is it a real problem though? If your config generator is complex enough to hide an infinite loop, you probably should be relieved every time it fails obviously and doesn't generate wrong config instead.
Post reply on HN