Hacker News new | ask | show | jobs
by swid 1346 days ago
Definitely this is a very fair criticism to my comment. I don’t fully agree yaml is bad, - I think it depends on use case But I appreciate you bringing up the other side; I agree somewhat that CircleCI is not as easy to use as it could be due to their choice.

FWIW, the most recent thing I built that could be considered a DSL is how we define roles where I work. It’s a lot like IAM policies. I wouldn’t want to run arbitrary code when parsing these documents, and I think yaml suits it well.

1 comments

> I wouldn’t want to run arbitrary code when parsing these documents, and I think yaml suits it well.

I understand your point that it might be harder for you to run arbitrary code. Depending on where it runs you need to make sure to isolate it.

But other than that, I think your imagination isn't correct. Because even if I want to define something like permission-policies, there is usually a lot of repitition that I'd like to factor out. And doing that with YAML is most often impossible.

But if you still decide to go with a non-programming language for configuration, then have a look at dhall: https://dhall-lang.org/

It allows a lot of logic/abstraction through functions and imports, is typesafe and also has builtin YAML generation. Even the few code examples at the page that I linked above show how you can factor things out easily there.