Follow

I'd heard that YAML was a mostly-superset of JSON, but I hadn't fully considered the implications of that until now:

It's actually mostly usable if you just wrap the entire file in a pair of curly braces and pretend it's JSON-but-the-keys-don't-need-to-be-quoted.

Mostly. Probably still *should* quote everything like it's JSON, otherwise you'll still eventually get bitten by the thing where `yes: no` parses as `{ "true": false }`.

@emily YAML: a format fit only for burning with fire, but it looks pretty so fucking everyone wants to use it for fucking everything, always

TOML, RON, and Dhall are all generally preferable to whatever mess YAML has become (sorry StrictYAML, even you)

@klardotsh alas, I don't have the energy to patch every bit of software I use to accept a different config format.

Not that the thought hasn't crossed my mind.

@emily thankfully you don't always have to: Dhall can compile to JSON and therefore you can write all YAML configs in Dhall (or Cue, or anything else that can compile to JSON, which is basically everything) if you're willing to accept a pre-processor step

we did this for GitLab CI configs at $PASTJOB using github.com/logixboard/dhall-gi

@klardotsh I have also considered the "find/write a preprocessor and cobble together some ridiculous pile of inotifywait commands to automatically regenerate them when the source file changes" route, yes.

I still do sometimes.

Sign in to participate in the conversation
Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!