5 ms·
I keep hearing from people here and there to use Dhall. Anybody has direct impressions?
by pdimitar 6y ago
I keep hearing from people here and there to use Dhall.
Anybody has direct impressions?
- andybak 6y agoJust took a quick look and the first example does that hateful thing with starting lines with commas. Even if that's just a convention thing it instantly makes me want to avoid it. Just allow trailing commas at the end of lists. It's much less jarring and unfamiliar. Trivial? Maybe. But my brain takes a while to adjust to new conventions and I do it way too frequently already.
- reactormonk 6y agoYou can have trailing commas just fine: https://github.com/dhall-lang/dhall-lang/pull/956 https://github.com/dhall-lang/dhall-lang/pull/956 However, `dhall format` is _very_ opinionated, and will remove it.
- andybak 6y agoDoes dhall format have an opinion about commas at the start vs end of lines? What's the recommended style?
- reactormonk 6y agoI formatted { foo = 3, bar = 4, baz = 5, verylongproperty = 6, dunnoneedsmoremore = 7, howmanytoforcealinebreak = 8 } And it forces the comma at the beginning of the line, Haskell-style: { foo = 3 , bar = 4 , baz = 5 , verylongproperty = 6 , dunnoneedsmoremore = 7 , howmanytoforcealinebreak = 8 }
- stickfigure 6y agoThis will not diff well if you add a new row at the beginning. It's the same problem with non-trailing-commas, but moved to the front instead of the end.
- Quekid5 6y agoIME people tend to just add stuff at the bottom. Doesn't help with ordered lists, though.
- reactormonk 6y agoIt's great if the system is built directly on top of it, e.g. spago. Not so much if you're trying to type yaml. Dhall is very opinionated, so trying to use it like TypeScript to type an untyped structure is... interesting. E.g. for Kubernetes: https://github.com/dhall-lang/dhall-kubernetes https://github.com/dhall-lang/dhall-kubernetes
- retzkek 6y agoA few months ago I explored using Dhall and Jsonnet to re-write an Ansible playbook [0,1]. I wanted to like Dhall, but found the type system got in the way more than it helped, while Jsonnet was very productive and a huge improvement over YAML. [0] https://www.kmr.me/posts/dhall_jsonnet https://www.kmr.me/posts/dhall_jsonnet [1] https://github.com/retzkek/ansible-dhall-jsonnet https://github.com/retzkek/ansible-dhall-jsonnet