-
Huh, it uses M4 to build its DSL, how quaint.
I wish there were more projects on the other side of the spectrum: take the script's self-reported usage string, à la docopt [0], and derive argument-parsing code from that. After all, we have GPT-4 now.
[0] https://github.com/docopt/docopts
-
Judoscale
Save 47% on cloud hosting with autoscaling that just works. Judoscale integrates with Django, FastAPI, Celery, and RQ to make autoscaling easy and reliable. Save big, and say goodbye to request timeouts and backed-up task queues.
-
I'm a fan of BashBoilerPlate (Bash3BoilerPlate) - https://github.com/xwmx/bash-boilerplate
It uses a similar style of deriving the arguments from the usage declaration, but it also includes some useful logging functions and is all in one script. There's some more info available on their style choices here: https://bash3boilerplate.sh/
-
TypeScript is now tenable for bash scripts with the fast-starting Bun runtime https://bun.sh/.
Before Bun, Node+V8 was just too slow to start.
IMHO all scripts should be written in TypeScript...you get typechecking and all the rest of the editing experience. Plus things like Wallaby.js for live coding/testing.
-
100% agree. There are some libraries like https://amoffat.github.io/sh/ that aim to make that easier, but they always have some quirks that, funnily enough, are often the corner cases you were hitting in your complicated Bash script in the first place.
-
-
oils
Oils is our upgrade path from bash to a better language and runtime. It's also for Python and JavaScript users who avoid shell!
Evolving bash, removing footguns, and providing a path forward is exactly what https://www.oilshell.org is about :) (a project that's nearly 7 years old)
The new language is here: https://www.oilshell.org/release/latest/doc/oil-language-tou...
I've gotten some great feedback on it, but it's not stable yet. You can still influence the direction of the language!
Latest release gives the status of the project: https://www.oilshell.org/blog/2023/03/release-0.14.2.html
As an anecdote, one thing that was extremely difficult was fixing all the footguns around set -e / errexit in bash.
However I believe we have done it: https://www.oilshell.org/release/0.14.2/doc/error-handling.h...
I got good feedback about this, and you can try it right now if you want to verify that the footguns are indeed fixed!