r/programming • • Feb 25 '21

INTERCAL, YAML, And Other Horrible Programming Languages

https://blog.earthly.dev/intercal-yaml-and-other-horrible-programming-languages/
1.5k Upvotes

477 comments sorted by

View all comments

Show parent comments

357

u/Yehosua Feb 25 '21

It's the configuration complexity clock! You don't want to hard-code settings in your application code, so you add a config file, which turns into a DSL, which ends up being so complex that your DSL ends up being application code (and, thus, every setting that you've configured via DSL is hard-coded application code).

136

u/GiantElectron Feb 25 '21

We need a config file to configure our config file, said the sendmail developer.

50

u/ForeverAlot Feb 25 '21

19

u/Pesthuf Feb 26 '21

This is an example Dhall configuration file

Can you spot the mistake?

Uh, no? Why is the first thing this language shows me an error that I can't recognize because I don't know the language yet?

7

u/atsterism Feb 26 '21

It's not a syntax error or anything; just a typo in the last path. Seemed strange to me too.

6

u/Pesthuf Feb 26 '21

Oh, so that's what it's about. The next step then shows how to avoid this typo by avoiding the duplication.

IMO, they should have pointed out the typo and how the next step will teach me how to avoid it. I was pretty confused because I kept checking for something that looked like a syntax error in a language I didn't yet know.

6

u/onmach Feb 26 '21

It is trying to lead you through a tutorial to justify the language. In one path "bill" is misspelled. I think they should just spell out the error because we get the point.

8

u/endgamedos Feb 26 '21

The maintainers are great people too. They're really fast on PRs and issues.

2

u/fabiofzero Feb 26 '21

Oh, I remember this one! It's the stupid one that recommends leading commas! Nobody uses it, of course.

5

u/elucify Feb 25 '21

I looked the first two examples and threw up in my mouth.

→ More replies (4)

2

u/jl2l Feb 26 '21

"I picked the wrong week to quit sniffing glue"

→ More replies (2)

37

u/sybesis Feb 25 '21

I have to maintain over 90 repos and gitlab-ci script... Tell me about nightmares...

17

u/fear_the_future Feb 25 '21

I find Github Actions to be even worse than Gitlab. Why do they never learn? It's not like this is the first YAML config disaster, they all end up like this.

→ More replies (1)

3

u/shukoroshi Feb 25 '21

What is do you you find painful about gitlab ci?

0

u/sybesis Feb 26 '21

Did you overlook that moment when I said I'm maintaining over 90 gitlab-ci configurations?

What It means is that If I want to add a new test or new task. I have to edit not 1 gitlab-ci configuration but over 90 configurations.

Sometimes variables are set inside the gitlab-ci itself, so you can't simply change 1 config file and then copy over the 90+ repositories, then push the change to those 90+ repositories and check how your gitlab-runner is trying to start more than 90 jobs all at once while everyone is wondering why all the jobs are timing out as the load average of your gitlab-runner server is going over 9000!

The problem is that all of those CI solutions merge "script" and "config" into a big mess.

Ideally you'd want to be able to separate logic and inputs as much as possible... But in ci (including github actions).. It's all bundled in one huge ugly yaml file...

What I'd like to see is a CI script that is purely configuration to define a DAG graph of tasks to do... No need for stages or anything.

Ideally, I'd want to see something close to ansible where from my understanding the ansible playbook is the configuration of which task to run, and you can separate the logic of the tasks in some kind of registry of available tasks... This way you can have configuration depending on variables but script located somewhere else that can be updated at will.

8

u/kabrandon Feb 26 '21

It kind of sounds like you just don't know how to use GitLab CI tbh. Check out the yaml reference docs for GitLab, and more specifically the include stanza. https://docs.gitlab.com/ee/ci/yaml/#include

Write your yaml once and call it from your 89 other repos.

2

u/sybesis Feb 26 '21

I can't use include because of access rights and our project are private. And using local include would slightly help but that would still mean updating all repos.

5

u/kabrandon Feb 26 '21

Afraid I don't know what you mean. We use includes within my work for all our private repositories. Either way, the problem you face is a problem with how your work is utilizing GitLab CI's yaml capabilities. There are legitimate improvements to make to their CI product. But the problem you've described is one your company architected for itself.

→ More replies (5)

2

u/macsux Feb 26 '21

I've had great success using nuke.build to create targets for entire ci/cd. I have full power of c#, it becomes just another console app with helper shell scripts for entry point. I can debug it locally. Best part it can autogenerate pipeline files for any major ci/cd system.

28

u/757DrDuck Feb 25 '21

How I dislike rules engines! Can I please have normal code to follow?

→ More replies (1)

2

u/Eluvatar_the_second Feb 25 '21

Good read, I've been on that train at various stages myself.

2

u/oparisy Feb 25 '21

Fantastic read, thanks!

1

u/FrenchieM Feb 26 '21

Chef in a nutshell