Live data from Hacker News

The Dhall Configuration Language

dhall-lang.org

11–20 of 192 posts

Re: The Dhall Configuration Language

#11

I love seeing useful languages that aren’t turing complete. Tooling gets much more interesting when you don’t have so many impossibility results around all the interesting stuff.

What practical advantages are there? Someone can always write a program that runs until the heat death of the universe even in a Turing-incomplete language.

Re: The Dhall Configuration Language

#13
post #5

{ home = "/home/bill" , privateKey = "/home/bill/.ssh/id_ed25519" , publicKey = "/home/blil/.ssh/id_ed25519.pub" } This is the most awkward abuse of formatting I've seen in a long time. Just allow/require a final trailing comma, and this nonsense goes away

This style is common in Haskell, Nix and Dhall. It also sees more "mainstream" use, e.g. in SQL.

Re: The Dhall Configuration Language

#14
post #10

> Can you spot the mistake? Nope, so now I have no incentive to use your config format because it's established something is wrong and it's completely non-obvious. Thanks for not wasting my time, I guess.

How could they make the mistake obvious? It's a mistake in a string value!

Re: The Dhall Configuration Language

#15

I love seeing useful languages that aren’t turing complete. Tooling gets much more interesting when you don’t have so many impossibility results around all the interesting stuff.

What practical advantages are there? Someone can always write a program that runs until the heat death of the universe even in a Turing-incomplete language.

Totality checking like that in Idris is one nice example. That's kind of circular though - it isn't Turing complete because it has totality checking (i.e. you must prove the program terminates).

Re: The Dhall Configuration Language

#16
post #5

{ home = "/home/bill" , privateKey = "/home/bill/.ssh/id_ed25519" , publicKey = "/home/blil/.ssh/id_ed25519.pub" } This is the most awkward abuse of formatting I've seen in a long time. Just allow/require a final trailing comma, and this nonsense goes away

Or allow a leading comma:

    {
    , home       = "/home/bill"
    , privateKey = "/home/bill/.ssh/id_ed25519"
    , publicKey  = "/home/blil/.ssh/id_ed25519.pub"
    }
Or, to make it markdown-ish:

    {
    - home       = "/home/bill"
    - privateKey = "/home/bill/.ssh/id_ed25519"
    - publicKey  = "/home/blil/.ssh/id_ed25519.pub"
    }
This is just to play with the idea that leading punctuation may be preferable because it all aligns in the same column.

Re: The Dhall Configuration Language

#17
post #10

> Can you spot the mistake? Nope, so now I have no incentive to use your config format because it's established something is wrong and it's completely non-obvious. Thanks for not wasting my time, I guess.

This opinion is ironic because this is exactly what the author intended to describe -- the typo IS hard to find.

The "Hello, World" example is nothing more than JSON, showing a string repeated 3 times. On the third time, "bill" is misspelled with "blil". The next tab shows how Dhall uses a variable definition to prevent this type of error.

Re: The Dhall Configuration Language

#18
post #5

{ home = "/home/bill" , privateKey = "/home/bill/.ssh/id_ed25519" , publicKey = "/home/blil/.ssh/id_ed25519.pub" } This is the most awkward abuse of formatting I've seen in a long time. Just allow/require a final trailing comma, and this nonsense goes away

Trailing comma is ugly as sin - I love the little "house" my leading commas put my record into :)

Re: The Dhall Configuration Language

#19
Dhall is my favorite configuration language that I never get around to using.

I manage DNS in Terraform, and since every Terraform provider uses different objects definitions, and every object definition is rather verbose, Dhall would be a way to specify my own DRY types and leave the provider-specific details in one place. Adding new DNS entries and moving several domains between providers would be a matter of changing fewer lines.

Dhall also has Kubernetes bindings:

https://github.com/dhall-lang/dhall-kubernetes

Although I'm tempted to just stick to Helm here: even though it's less type-safe, Dhall's verbosity makes me reconsider.

I'd like to hear if anyone has used dhall-kubernetes if they like it.

Re: The Dhall Configuration Language

#20
post #10

> Can you spot the mistake? Nope, so now I have no incentive to use your config format because it's established something is wrong and it's completely non-obvious. Thanks for not wasting my time, I guess.

Meh, I think you're pointing out why doing this with a variable is better. In other words that mistake is the entire point of the example. Perhaps the definitions tab could make it more clear what the mistake was.
Post reply on HN