Hacker News new | ask | show | jobs
by dijit 1501 days ago
This is so awful. I hope nobody ever actually uses it seriously.

As a person who has less hate than most people about bash; there are better options.

I understand the frustration with ansible, with DSLs in general and the slow creep they all take to becoming proper languages with loops and conditionals- only with worse semantics than real languages.

But this isn’t the way.

1 comments

Genuine question, why not? The Bash shell is one of those things that people love to hate on, and yet -- it's still here. What makes this approach inferior?
Sure, I should be clearer!

Shell semantics are terse and powerful, single character changes can completely alter the control flow of a sequence and can be very difficult to follow.

Managing data structures is also full of foot guns.

I don’t want to be too specific because you can “get around” a lot of issues if you know what you’re doing, the problem is that it’s very easy to introduce subtle bugs and not know about them for a long time- or that you can introduce bugs and not understand how or why.

Shell works great for piping together series of text and running commands in sequence and conditionally; but once you’re at the point where you’re parsing config files to do control flow and you’re sourcing more than a handful of files then controlling the quality of the script becomes very difficult.

Personally, I’ve written 100kLOC bash, I’m very comfortable with the semantics, but I still get tripped up sometimes because of some weird quirk that is not widely understood.

A shell and a programming language accomplish very different things - i.e. there's a reason pure Python makes for an annoying shell but is the next step up once you get even a little complicated.