Config languages (and Dhall)

Can’t look at your PR. Maybe Gitlab will be online next week.

The main problem I see with this approach is that I don’t really want to maintain the python type definitions on my own. So who will?

The dhall types can easily be generated. I could then have a ghcup subcommand, say ghcup dhall-types, that outputs a dhall file that can then be imported by your scripts.

Given that the type definition is less than 50 lines, I don’t think maintaining the definitions is going to be a bottleneck of anyone’s time. Depending on whatever you’re going to change, the logic to:

  • Map between CI pipeline results to artifacts to entries in the yaml; and
  • Updating the yaml anchor generating logic (if you care about that)

The above are going to take much more time. Switching to Dhall would optimize the <50 lines, while leaving the actual business logic problem open :grimacing:

The nice thing of the updated Python code, is that the type checker will guide you along the way.

You mean my time?

There’s already too many things I do manually and I will not add another.

If someone else wants to maintain those type definitions, they can do so, but they will ultimately go out of sync.

To be honest I don’t know who is responsible for that file. Who is responsible for it right now?

I have no idea. And I want to give upstream projects (including e.g. cabal or anyone else) the tools to get a source of truth from GHCup. That won’t be the case if this file is maintained manually by a third party.

I think I see what you mean. The script effectively downloads https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-2026-0.0.7.yaml, modifies it, and prints it back to stdout.

That indeed does not have any source of truth about types/yaml format from ghcup itself it seems. I can also imagine it’s challenging to change this format, as there is a dependency between the nightly/release run, and that hosted file. They would both need to be updated. Unless the CI job is what updates it in the first place :thinking:.

What about Tweag’s Nickel? It looks a bit easier than Dhall.

There’s also expresso.

Sharing for fun from This PLT Life (a tumblr I wish would return!):

When I discover that my configuration file format is turning into one of those bad DSLs
IMG_1094