News for hackers. Stuff that matters.
Re:Was Rust Worth It? by HKH2 on Wednesday October 25, 2023 @08:53PM (#38020359)
> Give me rusty bash.

Bash with types (especially floats), fewer edge cases, functions with explicit parameters, simple command line flags...

Re:Was Rust Worth It? by AgentME on Wednesday October 25, 2023 @09:02PM (#38020429)
You're skipping the most needed improvement of all: fixing the issue where scripts with unquoted variables will seem to work until they contain a space. Almost every single bash script of more than a dozen lines I've seen outside of large open-source projects fails if a user puts a space in a file path, because the programmer didn't understand the insanity of variable quoting rules! I don't know of any programming language with a more common major footgun.
Re:Was Rust Worth It? by HKH2 on Wednesday October 25, 2023 @09:23PM (#38020592)
Shellcheck does cover that. I think the bigger problem is people programming without warnings (in any language).
Re:Was Rust Worth It? by fbdab103 on Wednesday October 25, 2023 @11:01PM (#38021177)
Now you have me curious - where do you see the need for floats in shell? You are more creative than myself, because I am struggling to come up with a situation where I would lean on this. A "path" type would be by far more useful to my work.
Re:Was Rust Worth It? by HKH2 on Thursday October 26, 2023 @02:45AM (#38022482)
I have a script which uses wmctrl to tile windows when I press a shortcut key (for when I'm using an editor and want the editor window to take up most of the screen).

I guess I could avoid floats using multiplication, but I would rather keep the code as simple as possible.

Re:Was Rust Worth It? by bbkane on Wednesday October 25, 2023 @11:31PM (#38021322)
Re:Was Rust Worth It? by rustshellscript on Thursday October 26, 2023 @03:10AM (#38022631)
Re:Was Rust Worth It? by Aerbil313 on Thursday October 26, 2023 @04:01AM (#38022978)
Check out nushell, the Rust of the shells.

I know it’s still not 1.0. Then just get fish. At least would save some keystrokes.

Re:Was Rust Worth It? by HKH2 on Thursday October 26, 2023 @12:43PM (#38028185)
Fish is an easy alternative. Thanks.
Re:Was Rust Worth It? by mike_hearn on Thursday October 26, 2023 @10:52AM (#38026372)
We use a Kotlin scripting variant for our own shell scripting needs at Hydraulic, it's pretty nice because we've joined it with a lot of internal APIs that make working with the filing system and network easy. It fits all those requirements and more (you can declare flags easily at the top level, it has built in progress tracking for slow operations etc).

It's not really a "product" per se but there's an old version for download and some lightweight docs here:

https://hshell.hydraulic.dev/

We've never worked out what to do with it. Ideas and feedback welcome. It's pretty nice to use, albeit you need to use IntelliJ to edit scripts if you want IDE features.