It reminds me of the Kowloon Walled City[1] -- originally a (likely cleanly built) fort that took on more and more people until it became a morass of people and buildings with no consistency or strong structural concerns.
Then Rails (and Ruby) get this reputation for being a Kowloon rather than the Fort.
Not that ruby is not slow compared to other languages, but it's not as slow as perceived.
Perf characteristics differ wildly between those.
It wasn't really cleanly built. And there are lots of stories in there. And the Japanese seems to love it.
I always wonder if someday we could rebuilt the whole thing as Hotel, resort and tourist attraction.
But then addressing your points:
- Raw performance is improving (see my other post)
- Monkey patching is less and less frequent (I'm maintaining pure Ruby, but also Rails app since 2005), is generally considered a bad practice
- Rails-centrism is gradually becoming a thing of the past (see gems like Hanami, Roda, Sequel, Kiba, dry-rb etc)
- Runtime metaprogramming brings a lot of benefits when properly used!
- Threadsafety (I'm the first to mention that) has gradually gotten much better
So well - we're getting somewhere!
A huge chunk of the devops world is written in Ruby (probably about the same in Go, much less in Python). It's still the "Perl of the future" and you'll find it all over the place. Rails is still big, especially in America--but there's a lot of other very influential stuff to it. If you're doing web there are other (I would say better, unless you're making Basecamp) libraries that do very well, too. Hanami is cool, Grape is good, and I'm in the process of building a Rack framework called `Modern` that's intended to be a turn-key, OpenAPI3-compatible framework to make the creation of API clients on the other hand a trivial experience.
These are (AFAIK) a big part of the magic in Ruby testing frameworks.
Perhaps you were thinking of rspec's changes in the last few years. They have been moving away from monkeypatching with some changes to their syntax. Previously they defined `Object#should` and handled assertions using syntax like `my_var.should eq(1)`. The new approach, which does not use refinements, is to handle assertions using a wrapper method that works like `expect(my_var).to eq(1)`. No refinements necessary for that though.
99.9% my work involved (past tense, I'm a Systems Engineer now) ETL processes and Ruby is a serious workhorse there. I've done extremely complex jobs in plain Ruby, the Kiba DSL or just using Ruby to augment/encapsulate shell commands (ruby script in crontab->curl wrapper[typhoeus] to fetch data & write to file->%x(some grep/sed/awk stuff)->do more work with output in ruby).
I've never found better tools for doing this kind of work. I've seen some _nightmarish_ Node or Python projects to do similar. It's very, very rare that Ruby and its performance are my bottleneck doing this kind of work. Usually it's platform (ahem...Salesforce) or database limitations. GNU Parallel fills in the gaps usually.
Ruby is the only language I've found where I can consistently hand off my work to others. They comment on the code being clean and they keep it clean with their changes.
The place I just got hired by is pretty much all Python. They half-joke about hating Ruby. I did all of my challenges/problem walkthroughs in Ruby because I felt like it best communicated the problem and problem solution in code.
The number of times I heard "that solution is so clean" or "this solution would be way more involved in Python" from my interviewers would take more fingers to count than I have hands.
You are sooooooooooo wrong it isn't even funny. I'm stuck coding to Ruby 2.2 and Ruby 2.5 is looking more and more like a totally different world.
> - Mutability
Never understood this complaint from people. I just recently started playing with a language that supports immutability (Kotlin) and it is weird to me that you guys seem to be asking for constants, rebranded. Even weirder is if I write my vars' names in CONSTANT_CASE I get yelled at by the code formatter!
Plus, in immutable languages, are there cases where immutability extends to nonscalar values like arrays or hashes or objects? That distinction just feels so...arbitrary.
Is data changing that big of a problem?
Yes, but it is hard to recognize it as such until you've experienced the alternative.
I don't know much about Kotlin, but the fact that it relies heavily on Java libraries is sufficient to tell me that it is a particularly poor example of the power of immutability. You see the usefulness of immutability when you have objects that are deeply immutable - when you pass them around, you know those functions haven't changed them. It is much easier to reason about deeply immutable objects than mutable ones.
> in immutable languages, are there cases where immutability extends to nonscalar values like arrays or hashes or objects
Yes, this is largely the point. Although, you will rarely see an immutable array or hashtable - more likely it will be a linked list or balanced binary search tree.
Makes sense, I can see the appeal now. Thanks
Yes, see (among others) Erlang or, if you like static typing with your immutable values, Haskell, both of which are pervasively immutable.
Even if you just look at what's been done in garbage collection alone, it's leaps and bounds.
The usual argument in favor of immutability is not that mutability is a big problem in general, but that when unexpected mutation occurs, it's a really hard to find (debug) type of problem.
If you have a well behaved codebase that does "a = { :foo => 'bar' }; render_hash_to_browser(a); store_hash_to_database(a);", you're fine: you can assume the same data ends up in the browser and in the database.
However, if that assumption ever fails ("users are seeing data that isn't in the database!") it's often a debugging nightmare, because you have to dig down into any code that might possibly ever touch the hash to see if it's accidentally mutating it. This includes utility functions, totally unrelated areas, et cetera.
If you have a good debugger to assist you, and an easy way to attach your code to a harness that follows bug-reproducing paths, you're set. But those things are a) never as present as we want them to be ("just don't write bugs, duh!") and b) tend to be harder to get working in old, large, monolithic projects--just the kind of projects where sneaky mutation can become a frequent issue.
Now, all debugging is hard. And a lot of it involves delving into code you've never seen/touched before to find a bug. But sneaky-mutability issues typically expose a much wider variety and volume of code as suspect. Because of that, mutability issues often tend to be, if not objectively more difficult, at least objectively more frustrating to debug.
With this as in all things, there's a spectrum. Some folks are fine with ultra-dynamic languages that let you mutate/bind anything, and protect against that with convention and tooling. Hell, some folks are fine with languages that mutate their data structures when you do nothing but read from them (https://perlmaven.com/autovivification). For others, they just want control over what you can bind to names (a type system, or "const"--the Java/etc kind--which prevents rebinding). Still more folks want the ability to opt into truly immutable deep data structures. And others want everything in their platform to be immutable when they use it, and have all the mutability (which you nearly always need, if only for performance alone) handled behind the abstractions of their runtime.
However, past a certain criticality or size (of code/complexity/age/number of developers threshold) of a project, it often becomes necessary to move "up" that ladder to something that provides more programmatic/automatic assurances about "what is happening to my data as it passes through all this code?"
Last time I checked I think that Ruby is faster than Python, and people generally seem to be okay with Pythons speed so I don't really think Rubys speed is as huge an issue as people make it out to be. Also, if this project that the OP mentions eventually realizes it's potential Ruby could become substantially faster than it is today. It will never approach JavaScript or Lua speeds, but faster is always better.
* Runtime metaprogramming from hell, * Monkey patching
Isn't this really the users fault though, just because the language allows bad stuff to happen doesn't mean we should ever do bad stuff.
* Little presence outside web development
Do yo consider NetSec to be web development? Because I've noticed Ruby is fairly active in NetSec but it doesn't get talked about a lot. I've also heard that Ruby is used extensively in embeded devices in Japan but due to the language issue it isn't known or discussed anywhere else. I'm sure there are other weird little corners as well that Ruby is active in but that just aren't really know.
Really? When did you look? PyPy has gotten pretty stinking fast.
- Raw performance
- Runtime metaprogramming from hell
- Monkey patching
- No real concurrency support, tons of non-threadsafe code and gems
- Too Rails-centric
- Little presence outside web development
- Little to no real innovation in the last years
- Mutability
- No optional / progressive types or type annotations
===
Things I love about Ruby:
- Clean syntax
- Although it's object oriented, it allows using a functional style
- Functional collection operations
- Productivity
- Flexibility
- Maturity
- Availability of high-quality libraries
- Availability of hosting solutions
- Friendly community
- Nice stack traces