4 ms·
Instability. Ruby has not been the same language for very long. Migrating to 1.9 was a huge hassle for many firms. This may seem like a long time ago in tech ye
by solidsnack9000 2y ago
Instability. Ruby has not been the same language for very long. Migrating to 1.9 was a huge hassle for many firms. This may seem like a long time ago in tech years; but then there was Ruby 2.0; and shell scripts, meanwhile, have stayed the same the whole time.
A secondary reason is that Ruby has been very slow for much of its life, which means that for situations where you need to run a huge stack of scripts -- init systems, for example -- it would be punishing.
Ruby does have a terse and intuitive syntax that would make for a good system shell. Although it has some magic, it is less magical and confusing than shell itself. Ruby provides many basic data types that experience has proven are useful for shell scripting -- like arrays and dictionaries -- and they are integrated in a much cleaner and clearer way than they are integrated into widely used shells like Bash.
System tools that are written in Go may still make sense to write in Go, though. Go, it is true, does not have a nice terse syntax for short scripts and one liners; and it doesn't have a default execution model where everything is in main and so on; but that is because it is not a scripting language. Other languages used to write system tools and system services -- like C, C++, Java and Rust -- don't have those things either.
- cortesoft 2y ago> Migrating to 1.9 was a huge hassle for many firms. This seems contrary to my experience. We took a large project from 1.8 to 1.9 to 2.0 to 3.0, and it was much easier than we expected. It was a lot easier than our Python 2 to 3 conversations were.
- solidsnack9000 2y agoThe comparison to Python isn't the relevant one. During that time, what was it like to migrate from shell to...probably the same shell?
- lolinder 2y ago> It was a lot easier than our Python 2 to 3 conversations were. Python's is (present tense very much intended) notoriously one of the worst-managed transitions in programming language history, so that's not exactly a ringing endorsement.
- KerrAvon 2y agoYour first two points don’t seem valid, in my experience. The Ruby 2.0 migration wasn’t that interesting from a compatibility perspective; it certainly wasn’t anything like Python 2 -> 3. And Ruby is __not__ slow compared to bash. I don’t where these myths get started, but someone needs to justify the Ruby-is-slow thing with actual data.
- networked 2y ago> I don’t where these myths get started, but someone needs to justify the Ruby-is-slow thing with actual data. As an outside observer of the Ruby world, I have an impression that it was Ruby MRI that was slow. CPU-bound synthetic benchmarks like the much-criticized Benchmarks Game showed Ruby ≤ 1.8 a good deal slower than CPython 2. Here is an illustrative comment from that time: https://news.ycombinator.com/item?id=253310 https://news.ycombinator.com/item?id=253310. People also complained about early Rails, and the perception of Ruby's performance got mixed up with that of Rails. Then YARV came out, and Ruby became several times faster than its MRI former self on different benchmarks (https://en.wikipedia.org/wiki/YARV#Performance https://en.wikipedia.org/wiki/YARV#Performance). With YARV, Ruby gradually caught up to "fast" interpreted languages. Now interpreted Ruby seems as fast as CPython 3 or faster in synthetic benchmarks (for example, https://github.com/kostya/benchmarks/blob/7bf440499e2b1e81fb76c9a4e164dc77cbe90841/README.md#benchb https://github.com/kostya/benchmarks/blob/7bf440499e2b1e81fb...), though still behind the fastest mainstream interpreters like Lua's. Ruby is even faster with YJIT.
- igouy 2y agoruby 3.3.0 vs ruby 1.8.7 https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/ruby-mri.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- igouy 2y agoAlso https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/ruby-python3.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- RulerOf 2y ago> Ruby does have a terse and intuitive syntax that would make for a good system shell. I learned enough PowerShell to be comfortable using it, and then picked up Bash and Ruby a few years later. I longed for a Ruby shell for a couple years.
- rewgs 2y agoFree name idea for whoever makes the Ruby Shell: "Rubish"
- chucke 2y agoMentioning 1.9 migration and ruby being slow? Python 2 to 3 was waaaaay worse and more negatively impactful, and equally slow (slower in most cases). Ruby never had US market penetrative as perl or python, which were basically invented in the US, and congregated people from the academic realm. These things aren't decided based on meritocracy (no things ever are).
- dragonwriter 2y ago> Mentioning 1.9 migration and ruby being slow? Python 2 to 3 was waaaaay worse and more negatively impactful Python 2-to-3 was mainly worse than Ruby 1.8 to 1.9 because Python had already won, and had a much bigger and more diverse ecosystem.
- chucke 2y agoThat's disingenuous. Python 3 was released around 2008, rails popularity was still rising. The community refused to upgrade for at least 10y, and several prominent libraries took as much to provide first grade python 3 support. Ruby 1.8 to 1.9 migration was by contrast way milder. It took 6 or 7 patch releases and around five years to release 1.9.3, the first from the 1.9 series people actually considered stable, but after that the community migrated because it was *significantly* faster than 1.8 . Python 3 on the other hand was slower overall than python 3 at least until 3.6. The fact that the community stuck with python through it all does say a lot about human psychology and sunken cost syndrome.
- solidsnack9000 2y agoCompare Ruby to shell, not Python, when considering what I wrote above.
- mega-tux 2y agoAlternatively, you can use Crystal instead of Go. Its syntax is almost Ruby one, except mostly for some typing. Standard library is also similar. Binary size and speed is also go-like
- mega-tux 2y agoOh, and there is a new interpreter although probably it's not production quality yet