Earlier quoted context omitted.
“X is unsuitable for large projects” when there are many readily discovered existence proofs to the contrary (including but not limited to $1B+ businesses, massive communities, deep thoughtful and disciplined engineering spokespeople, etc.) strikes me as a common trope here on HN. (Which is not to say X is flawless even at scale or a clear best fit along all axes. That is true for no X that I know of.)
The fact that a language is used for large, successful businesses/projects doesn't mean another language wouldn't be better. It's just terribly difficult to measure such things.
Ruby: A great language for shell scripts
121–130 of 368 posts
Re: Ruby: A great language for shell scripts
#122Earlier quoted context omitted.
I think golang is used because you can easily create a single static binary, which is incredibly easy to distribute. I often find non-trivial CLI tools written in Python cumbersome because of the dependency wrangling necessary.
> I often find non-trivial CLI tools written in Python cumbersome because of the dependency wrangling necessary. I'm thinking of trying out Mojo in large part because they say they're aiming for Python compatibility, and they produce single-file executables. Previous to that I was using PyInstaller but it was always a little fragile (I had to run the build script a couple of times before it would successfully complet…
From the website, "D's blazingly fast compilation allows it to be used as a high level, productive scripting language, but with the advantages of static type checking" [3].
[1]Why I use the D programming language for scripting (2021):
https://news.ycombinator.com/item?id=36928485
[2]Adding ANSI C11 C compiler to D so it can import and compile C files directly:
Re: Ruby: A great language for shell scripts
#123Earlier quoted context omitted.
> I sometimes wonder why we don't see ruby used for shell stuff more often. The reason we don't see Ruby used more for shell stuff is because Python won this particular war. It's already installed on basically every Linux distribution out there, and this simple fact outweighs all other language considerations for probably >95% of people who are writing shell scripts in something that isn't Bash. Personally, I don't m…
How hard is to install it though? That doesn't sound like a reason not to use it.
Re: Ruby: A great language for shell scripts
#124As a self proclaimed shell advocate I am… intrigued. As a self proclaimed shell advocate, I also have a revulsion to back ticks.
Re: Ruby: A great language for shell scripts
#125Re: Ruby: A great language for shell scripts
#126Earlier quoted context omitted.
> ... maybe extract those files to required files, add gems, whatever. CPAN is the killer feature of Perl. It just works. First off, most of the time I don't need a CPAN module for doing shell scripting in perl. Perl itself is rich enough with the file manipulations that are needed for any script of less than 100 lines. My experiences with Ruby and installing gems have been less pleasant. Different implementations of…
Does anyone under age 50 or so even know Perl?
Re: Ruby: A great language for shell scripts
#127The greatest feature for this is inline deps, something very rare to have built-in (I've only found Deno to have a similar feature): https://bundler.io/guides/bundler_in_a_single_file_ruby_scri...
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p cowsay imagemagick
identify "$1" | cowsay
https://nixos.wiki/wiki/Nix-shell_shebangRe: Ruby: A great language for shell scripts
#128I sometimes wonder why we don't see ruby used for shell stuff more often. It inherited most of the good stuff for shell scripting from Perl, and Perl took a lot of it's syntax from sh and sed and awk, so almost anything you can do in shell script you can do in ruby, but with an option of making it gradually less terse and more readable, while having sane variables and data handling from the start. Also ruby is great…
> I sometimes wonder why we don't see ruby used for shell stuff more often. The reason we don't see Ruby used more for shell stuff is because Python won this particular war. It's already installed on basically every Linux distribution out there, and this simple fact outweighs all other language considerations for probably >95% of people who are writing shell scripts in something that isn't Bash. Personally, I don't m…
Re: Ruby: A great language for shell scripts
#129I've mostly been in the Python ecosystem for the past few years and the LSP investment from Microsoft has really shown. Rich Python support in VSCode is seamless and simple. Coming back to Ruby after that caught me off guard - it feels like I'm writing syntax-highlighted plain text. There's an LSP extension from Shopify, but it's temperamental and I have trouble getting it working.
Editor support isn't everything (the actual language design is still the most important), but it definitely affects how eager I am to use it. I basically never choose Ruby over Python given the option, which is too bad. Ruby's a cool language!
Re: Ruby: A great language for shell scripts
#130Earlier quoted context omitted.
How hard is to install it though? That doesn't sound like a reason not to use it.
Mitigating the risk of downloading a script from the internet and executing it -- even from a "trusted" website or package manager -- is absolutely a good reason not to use it.
I don't really get this whole defaults being a blocker for tools choice.