1/28/2026 at 8:33:37 AM
This is the way. Shell makes for a terrible scripting language, that I start regretting choosing usually around the time I have to introduce the first `if` into my "simple" scripts, or have to do some more complex string manipulation.At least nowadays LLMs can rewrite Bash to JS/Python/Ruby pretty quickly.
by pzmarzly
1/28/2026 at 3:01:33 PM
This is exactly the frustration that lead me to write Rad [0] (the README leads with an example). I've been working on it for over a year and the goal is basically to offer a programming language specifically for writing CLIs. It aims for declarative args (no Bash ops parsing each time), automatic --help generation, friendly (Python-like) syntax, and it's perfect for dev build scripts. I'll typically have something like this: #!/usr/bin/env rad
---
Dev automation script.
---
args:
build b bool # Build the project
test t bool # Run tests
lint l bool # Run linter
run r bool # Start dev server
release R bool # Release mode
filter f str? # Test filter pattern
filter requires test
if build:
mode = release ? "--release" : ""
print("Building ({release ? 'release' : 'debug'})...")
$`cargo build {mode}`
if lint:
print("Linting...")
$`cargo clippy -- -D warnings`
if test:
f = filter ? "-- {filter}" : ""
print("Running tests{filter ? ' (filter: {filter})' : ''}...")
$`cargo test {f}`
if run:
bin = release ? "target/release/server" : "target/debug/server"
$`./{bin}`
Usage: ./dev -b (build), ./dev -blt -f "test_auth" (build, lint, test auth), ./dev -r (just run).
Actively being developed!
by amterp
1/28/2026 at 5:24:28 PM
Does this spawn a new shell for every instance of $`...`?by oguz-ismail2
1/28/2026 at 7:57:20 PM
Yep each one is a fresh session. Are you asking because you'd like a persistent one?by amterp
1/28/2026 at 8:50:55 AM
Well, at least I will be able to run my bash scripts in 5 yearsby kh_hk
1/28/2026 at 12:48:18 PM
I don't know Ruby, but chances are that your Python/JavaScript scripts are going to run in 5 years as well, if you stick to standard library.by g947o
1/28/2026 at 2:51:18 PM
Just don't use any NPM libraries (if possible) and you'll be fine. I personally wouldn't use typescript for this sort of thing.by dmix
1/28/2026 at 4:39:57 PM
Why not? You can have bun or even node these days run it directly.by sroussey
1/28/2026 at 7:18:21 PM
I've been using node for a decade now and I've had to update NPM libraries a number of times as Node itself upgraded. I have a feeling it will get a lot more stable with ESM and the maturity of the language but if you're writing something you need to run 5-10yrs from now I wouldn't touch a library unless it's simple and has few of it's own dependencies.by dmix
1/29/2026 at 1:12:16 PM
Deno has used ESM from the beginning and it’s required on jsr.io. I agree about avoiding dependencies, but maybe it’s okay if they’re locked to a specific version.by skybrian
1/28/2026 at 1:18:36 PM
and then your mamba changesby ChrisGreenHeur
1/28/2026 at 1:25:56 PM
What's that even meanby nilamo
1/30/2026 at 12:52:32 PM
https://github.com/mamba-org/mambaby ChrisGreenHeur
1/28/2026 at 2:21:36 PM
no one knows what it means, but it's provocative!!by g_delgado14
1/28/2026 at 10:02:16 AM
Fair. My bash scripts only broke 3 times over the years:- when ls started quoting filenames with spaces (add -N)
- when perl stopped being installed by default in CentOS and AlmaLinux (had to add dnf install -y perl)
- when egrep alias disappeared (use grep -E)
by pzmarzly
1/28/2026 at 7:11:16 PM
>- when ls started quoting filenames with spaces (add -N)Your fault: http://mywiki.wooledge.org/ParsingLs
by meindnoch
1/28/2026 at 8:03:07 PM
Kinda tells you everything you need to know about the design of the system when using it the default way is utterly unsafe.by oblio
1/28/2026 at 2:15:33 PM
I consider luajit a much better choice than bash if both maintainability and longterm stability are valued. It compiles from source in about 5 seconds on a seven year old laptop and only uses c99, which I expect to last basically indefinitely.by norir
1/28/2026 at 10:50:18 AM
Bash is not a great cross-platform choice. Too many subtle differences.The best way is a scripting language with locked-down dependency spec inside the script. Weirdly .NET is leading the way here.
by greener_grass
1/28/2026 at 2:14:54 PM
Stick to posix shell and it will run anywhere and on anything no matter how old.by goalieca
1/28/2026 at 10:58:19 AM
Python with uv seems decent in here too.by Imustaskforhelp
1/28/2026 at 11:24:02 AM
python does EOL releases after 5 years. I guess versions are readily available for downloading and running with uv, but at that point you are on your own.bash is glue and for me, glue code must survive the passage of time. The moment you use a high-level language for glue code it stops being glue code.
by kh_hk
1/29/2026 at 5:25:03 PM
Hard disagree... I find that Deno shebangs and using fixed version dependencies to be REALLY reliable... I mean Deno 3 may come along and some internals may break, but that should have really limited side effects.Aside: I am somewhat disappointed that the @std guys don't (re)implement some of the bits that are part of Deno or node compatibility in a consistent way, as it would/could/should be more stable over time.
I like Deno/TS slightly more because my package/library and version can be called directly in the script I'm executing, not a separate .csproj file.
by tracker1
1/28/2026 at 2:00:26 PM
>Too many subtle differences.Such as?
by oguz-ismail2
1/28/2026 at 2:17:09 PM
This entire list: https://www.shellcheck.net/wiki/by hiccuphippo
1/28/2026 at 3:09:56 PM
How is any of that a subtle difference between platforms?by oguz-ismail2
1/28/2026 at 2:30:13 PM
The tools you will call from your bash script differ in subtle ways between Linux, macOS, MinGW.One good example is `uuidgen`
by greener_grass
1/28/2026 at 3:11:28 PM
>uuidgenThat's neither a standard CLI utility nor a bash builtin.
by oguz-ismail2
1/29/2026 at 6:18:05 PM
Technically maybe, I don't know. But in practice, your bash will use tools like this and break if they are different / missing on a future build host.If using a programming language with locked-down package dependencies, then all you need is the compiler/interpreter and your script will work.
by greener_grass
1/28/2026 at 9:00:39 AM
For some quality of "run", because I'm hella sure that it has quite a few serious bugs no matter what, starting from escapes or just a folder being empty/having files unlike when it was written, causing it to break in a completely unintelligible way.by gf000
1/28/2026 at 9:24:04 AM
I guess we have wildly different expectatives of what a language is responsible for and what not.by kh_hk
1/28/2026 at 2:28:46 PM
> This is the way. Shell makes for a terrible scripting language, that I start regretting choosing usually around the time I have to introduce the first `if` into my "simple" scripts, or have to do some more complex string manipulation.I suppose it can be nice if you are already in a JS environment, but wouldn't the author's need be met by just putting their shell commands into a .sh file? This way is more than a little over-engineered with little benefit in return for that extra engineering.
The reasons (provided by the author) for creating a Make.ts file is completely met by popping your commands into a .sh file.
With the added advantage that I don't need to care about what else needs to be installed on the build system when I check out a project.
I just don't see the advantages.
by lelanthran
1/28/2026 at 2:55:46 PM
The benefit is you can easily scale the complexity of the file. An .sh file is great for simple commands, but with a .ts file with Deno you can pull in a complex dependency with one line and write logic more succinctly.by dsherret
1/28/2026 at 3:47:08 PM
> The benefit is you can easily scale the complexity of the file. An .sh file is great for simple commands, but with a .ts file with Deno you can pull in a complex dependency with one line and write logic more succinctly.The use-case, as per the author's stated requirements, was to do away with pressing up arrow or searching history.
Exactly what benefit does Make.ts provide over Make.sh in this use-case? I mean, I didn't choose what the use-case it, the author did, and according to the use-case chosen by him, this is horrible over-engineered, horribly inefficient, much more fragile, etc.
by lelanthran
1/29/2026 at 5:27:04 PM
The differences between different environments can vary a lot... many shell scripts rely on certain external programs being available and consistent... this is less true across windows an mac and can vary a lot.I've found that Deno with TS specifically lets me be much more consistent working on projects with workers across Windows, Mac and Linux/WSL.
by tracker1
1/28/2026 at 8:37:50 AM
I use swift! I even (re-)wrote swift-sh[0] to make it possible to import external modules in a script (à la uv).by frizlab
1/28/2026 at 3:31:38 PM
I've been working a lot in fairly complex shell scripts lately (though not long— not much over 1000 lines). Some of them are little programs that run locally, and others drive a composable cloud-init module for Terraform that lets lets users configure various features of EC2 hosts on multiple Linux distribution without writing any shell scripts themselves or relying on any configuration management framework beyond cloud-init itself. With the right tooling, it's not as bad as you'd think.For both scripts, everything interesting is installed via Nix, so there's little reliance on special casing various distros', built-in package managers.
In both cases, all scripts have to pass ShellCheck to "build". They can't be deployed or committed with obvious parse errors or ambiguities around quoting or typos in variable names.
In the case of the scripts that are tools for developers, the Bash interpreter, coreutils, and all external commands are provided by Nix, which hardcodws their full path into the scripts. The scripts don't care if you're on Linux or macOS— they don't even care what's on your PATH (or if it's empty). They embrace "modern" Bash features and use whatever CLI tools provide the most readable interface.
Is it my favorite language? No. But it often has the best ROI, and portability and most gotchas are solved pretty well if you know what tools to use, especially if your scripts are simple.
by pxc
1/29/2026 at 1:32:42 PM
A lesson I learnt during the 90's already switching into Perl instead, somehow people keep writing pieces of wonder in plain shell scripts.by pjmlp
1/28/2026 at 9:54:46 AM
Agreed. The shell is great for chaining together atomic operations on plaintext. That is to say, it is great for one liners doing that. The main reason probably isn't how it all operates on plain text but how easy it makes it to start processes, do process substitution, redirections, etc.As soon as you have state accumulating somewhere, branching or loops it becomes chaotic too quickly.
by sureglymop
1/28/2026 at 1:47:20 PM
I generally use AWK as my scripting language, or often just write the whole thing directly in AWK. It doesn't change, is always installed on all POSIX platforms, easily interfaces with the command line, and is an easy to learn small language.by wmwragg
1/28/2026 at 2:38:35 PM
Could you please provides examples on how to do it? Specially given that the operating system calls dont return back the output of the command? Thxby camilomatajira