3 ms·
So you haven't used the languages I listed but you want to judge them? No shame in that but if you want to ask why people use Ruby, I'd say you answered your ow
by cercatrova 6y ago
So you haven't used the languages I listed but you want to judge them? No shame in that but if you want to ask why people use Ruby, I'd say you answered your own question, it's due to inertia, and if you actually want to compare these other languages, you have to actually use them to some non-trivial extent.
And I'd also say a big one is Rails, I'm not sure of many people who use Ruby outside of Rails. But that is because they're using Rails despite it being in Ruby, not necessarily because of it, because again, they're more interested in the features that Rails provides rather than being enamored with any language feature per se.
- pmontra 6y agoNo way, I learned Ruby after 20 years of programming. Languages that earned me money before Ruby: C, Perl, Delphi (or something on DOS similar to it), Visual Basic, a little Visual C++, PHP, Java, JavaScript, even some Cobol plus a number of other languages for fun (hello to Postscript, Tcl, Forth, Pascal, BCPL, several assemblys and too many others to remember). Ruby was so much better. Garbage collection as in all interpreted languages, no types to write and a number of niceties that made me happy. As you wrote, I started with Ruby because of Rails and I slowly migrated all my scripts from Perl to Ruby. Ruby is the language I use for my projects, plus some Node when I have to. Everything else is too hard, life is too short to waste it wrestling with those other languages. If I had to write something very parallel I'd go with Elixir. We'll see what Ruby's Ractors will bring to us.
- cercatrova 6y agoThe fact of the matter is, Ruby and Python are badly implemented, speed wise. The other commentor states more about this. JS is super fast with a JIT but Ruby and Python are still stuck with slow implementations.
- KronisLV 6y agoSeems about right. Luckily, if performance becomes an issue, you can probably scale out horizontally, or perhaps if you don't care much about sticking to the reference implementations, you can consider using alternative ones. For example, there are benchmarks of some of the Ruby implementations here: https://pragtob.wordpress.com/2020/08/24/the-great-rubykon-benchmark-2020-cruby-vs-jruby-vs-truffleruby/ https://pragtob.wordpress.com/2020/08/24/the-great-rubykon-b... And here's a paper from 2016 comparing some of the Python implementations: http://kth.diva-portal.org/smash/get/diva2:912464/FULLTEXT01 http://kth.diva-portal.org/smash/get/diva2:912464/FULLTEXT01 Of course, performance in real world scenarios and when using larger frameworks (such as Ruby on Rails or Django) may differ from synthetic benchmarks, but it's nice that at least there's work done in creating these alternative implementations. A bit like how we have Hotspot and OpenJ9 for Java as well or even how there's glibc and musl - that way you can choose which implementation is the most suited for your needs, be it for performance reasons or others...
- igouy 6y agoAlso https://pybenchmarks.org/ https://pybenchmarks.org/
- cpuguy83 6y agoExcept there is jitted Ruby. Rubinius and jruby to start. Even (C)Ruby 3.0 literally touts JIT as one of the pillars that make it 3x faster than 2.0, granted it is only optimized for a certain kind of code (not Rails) in 3.0.
- klibertp 6y agoYou're caring too much. Why is it so important to you that two particular implementations of two programming languages are badly implemented and thus (which doesn't actually automatically follow, but nevermind that) slow? Are you being forced to use them against your will? Have you developed a trauma? My advice would be to change a job and stop caring. It would be healthier in the long run... As for the subject matter: yes, Python and Ruby are somewhat slow, which is absolutely fine for a lot of projects and in a lot of contexts. Where the slowness is problematic, they simply shouldn't be used, and if they are, it's an engineering or organizational failure. Don't blame poor decision making on the language implementation!
- cercatrova 6y agoI mean, I am forced to use them if I use apps, sites and services running on Ruby and Python right? And why shouldn't I care that things are slow? I don't really appreciate you sarcastically armchair diagnosing me with trauma which can be a serious thing for many people.
- zmmmmm 6y ago> Python and Ruby are somewhat slow, which is absolutely fine for a lot of projects and in a lot of contexts You can say that, but it presumes they are better than alternatives in other regards when there are options with really no disadvantages but better performance. The primary reason for using these languages appears to be that they are easy to learn when getting started (either as a new developer or a new project). But when you think that you're optimising to save a couple of months coming up to speed on tech over a lifetime of maintenance and performance benefits ... it seems lazy to me.
- pdimitar 6y agoAlmost any web-public-facing project is very parallel so Elixir should be a no-brainer, provided no artificial limitations on which technology to use (which is a very generous assumptions, granted).
- mypalmike 6y agoI think you're pretty much wrong on that last point. The people I know who love Rails tend to rave about Ruby the language. It's not personally my favorite (spent about 2 years with it as my daily language, no rails involved) but it has many many fans.
- cercatrova 6y agoHow can you tell that that is due to them liking the language because they work with a nice framework on top of it? If I worked all day in a a language, I'd like at least some parts of it.
- mypalmike 6y agoThese people had experience with many other languages prior to Ruby. And they choose it for non-rails projects. A lot of the love for Ruby seems to center around the widespread use of generators and the clean syntax for invoking them. And some people truly love duck typing.
- pdimitar 6y agoPeople are raving about all sorts of stuff and that doesn't mean they know what they are talking about. I've been a party pooper on a Rails meetup before, people were extremely clueless where Ruby ends and Rails starts. Nothing wrong about it, but it can be a bit worrying sometimes how much misinformation is being spread. For the record, I like Ruby -- but no longer work with it. I feel there are languages that picked up its slack for years now. Might come back to it now with the 3.0 release (provided Rails works with it). Actually excited to see if it's better now. So I am not mindlessly hating. But "raving" about something is not a data point.