News for hackers. Stuff that matters.
Re:Running GitHub Actions for Certain Commit Messages by simonw on Thursday October 01, 2020 @09:30AM (#24650578)
Embedding one language in another isn't an uncommon pattern.

Regular expressions and SQL in my Python

JavaScript and CSS in my HTML

Sed / Awk / etc in my Bash

Embedding a custom conditional syntax in YAML feels pretty tame in comparison to those.

Re:Running GitHub Actions for Certain Commit Messages by toomanybeersies on Thursday October 01, 2020 @10:40AM (#24651338)
Except that every tool that uses YAML config files has its own unique language for embedding conditional logic, with enough similarities to be familiar, but enough differences and idiosyncrasies to be frustrating, requiring you to re-read the documentation every time you need to write anything as it's impossible to remember the half-dozen different dialects of "YAML logic". I also encounter this every time I need to write a non-trivial regular expression, I can never remember the differences in regex syntax for sed, ruby, JS, etc. etc.
Re:Running GitHub Actions for Certain Commit Messages by marcosdumay on Thursday October 01, 2020 @12:50PM (#24653200)
What benefit is the YAML giving you?

On your examples, one mixes an specialized language into a general one. The general language is much better for most tasks, but once in a while there is a problem that fits the specialized one. But YAML isn't much better than a general language for defining data structures (what config files are), and isn't general in any way.

Re:Running GitHub Actions for Certain Commit Messages by baq on Thursday October 01, 2020 @11:23AM (#24651949)
very good points - i disagree on nuances:

- Python provides a grammar for its implementation of regex (note that some langauges make regexes first-class syntax - perl, JS)

- JS has a defined standard cross-platform cross-browser syntax, ditto CSS (yes i know it's not 100% true)

- sed/awk in bash - i agree - but there's a bigger POSIX standard which defines all of it

the problem with yaml is that it isn't even a language, it's just a way to describe a recursive tree/list data structure. everybody defines their own language pretending to standardize on yaml where in fact the syntax similarities are doing little more than mislead you what product you're creating documents for.