546 points · by haven · 13y ago · 285 comments
Refinements, as I understand them, are a bad idea.
I understand the motivation, but this is not the way to go about it. There's now a new scope all over the place (the set of refinements applied to any given class). This means that the behavior of any given class now can depend heavily on context.
This makes optimization a bitch, for the same reason that it makes programming a bitch. I can now have two Strings, one Refined by ActiveRecord, the other Refined by Sequel, which expose a different set of incompatible methods.
I have been awaiting Ruby keyword arguments for a very long time, but the first time I heard them brought up (relating to 2.0), the person explaining had some qualms with how they were implemented. For the life of me I cannot remember what bothered them, but if that rings a bell for anyone else, please chime in.
https://twitter.com/brixen/status/281180931950264320
https://twitter.com/garybernhardt/status/281181122736582656.
Not sure if that's what you're thinking of.
@ch0wn: I'm pretty sure that chao- was talking about the implementation of keyword arguments, not refinements.
sub withCamelize (&) {
my ($thunk) = @_;
local *{'String::camelize'} = sub { ... };
$thunk->()
}
sub camelize_and_join {
my ($str_ary) = @_;
withCamelize {
join ', ', map { $_->camelize } @$str_ary
}
}
So you can probably already accomplish the same with Ruby's equivalent of 'local' for dynamic scoping.A better design approach to achieve this effect is wrapper objects (similar to jQuery and Underscore.js) where I can add functionality to existing objects. Ruby has everything we need for this already, and makes it quite easy to do.
In summary, they makes the Ruby language harder to implement, and Ruby code harder to understand. You can't pretend they don't exist if their existence compromises the meaning of your code and the performance of your chosen Ruby implementation.
Since so many people dislike them, I wonder what the community response will be? Will JRuby just leave them unimplemented? That seems bad, but I'm not sure I'd mind too much. But that's not viable if it means Rails and other things won't work on JRuby.
A bit offtopic, but since you said that and you seem to be both fond of functional programming and in touch with latest ruby developments, you're probably a good person to ask: How the heck do you do "normal/proper" currying in Ruby? And how do you do it with keyword arguments? (I'm trying to compile a list of functional-idiom examples in popular dynamic language, and when I reached Ruby and currying, all the snippets I found made me go "WTF?!"...)
>> add = -> x, y { x + y }
=> #<Proc (lambda)>
>> add.call(3, 5)
=> 8
>> add.call(3)
ArgumentError: wrong number of arguments (1 for 2)
>> curried_add = add.curry
=> #<Proc (lambda)>
>> add_three = curried_add.call(3)
=> #<Proc (lambda)>
>> add_three.call(5)
=> 8
If you want a no-brainer way of currying methods, you're SOL.irb(main):004:0> multiply = -> a, b { a * b } => #<Proc:0x007fe2822029e0@(irb):4 (lambda)>
irb(main):006:0> square = -> a { multiply.call(a, a) } => #<Proc:0x007fe2840746a8@(irb):6 (lambda)>
irb(main):007:0> square.call(3) => 9
"Hello".method(:split).to_proc.curry[""]
=> ['H', 'e', 'l', 'l', 'o']
If you want to even make the receiver an argument it would take a little more hoop jumping, but with a tiny monkey patch you can enable something like this: "Hello".curry.split[""]The current behaviour makes the scope global, and one would simply overwrite the methods of the other, surely that is a worse thing, no?
I agree. Some feature to debug monkey patching conflicts is needed. But do we really have to change methods call logic to achieve that goal?
I would like to see some diagnostic feature one can just turn on/off. Something that just shows conflicts.
Ruby also has utility for doing lots of scripting type tasks (things like Jekyll). The libraries you need to do this are simple to write. Python is perfectly adequate for this task already, as is Node (modulo callback spaghetti). So there is no barrier to entry here.
In summary I don't see any project going forward that provides enough value to maintain interest in Ruby. Thoughts?
[NB: I'm not saying Ruby is going to die overnight. I just think it will slowly become less relevant.]
In terms for barrier to entry with Python, the issue is that a lot of us chose Ruby over Python already for very specific reasons. Pythons whitespace usage, for example, makes it DOA for me. I'm not touching it. If it works for you, great. It doesn't work for me.
Ruby is the project that provides enough value for me to maintain interest in Ruby, and that's what I see with lots of other Ruby users too: The language is sufficiently more fun to work with that we're willing to put up with quite a lot, including horrible performance, to work with it.
Ruby might become less relevant to others, but I don't care if that were to happen. It will only become less relevant to me the day a new language comes along that is even more pleasurable to program in. So far I've not seen anything get close.
This has to be up there with people claiming they don't like Lua because array indexing starts at 1 instead of 0. Of all the weaknesses of Python, focusing on something so superficial just seems lazy.
Perhaps in the future just say that you're experienced and comfortable with Ruby and have no reason to investigate Python at the moment. :)
You can reasonably argue that a project team should already have and enforce a coding style guide, so specifying a "tab" isn't a big deal. But what if you're part of two separate projects which different coding standards? Do you use Editor A for Project A, and Editor B for Project B? Or do you maintain separate configuration profiles, one for each project? Granted, this also isn't a big deal: Just "git checkout ProjectA" in the directory where you keep your preferences before you start coding. But it is an extra step in your workflow.
You can use the "-t" or "-tt" flags to spit warnings or errors if someone mixes tabs and spaces, so any conscientious group can easily catch whitespace incompatibility problems. But Python's whitespace usage has organizational consequences, and it can affect a developer's choice of tools and/or workflow. For some people, this is not a superficial impediment.
Indexing starting at 1 is not only irritating, it's mathematically difficult. Certain concepts actually can't be described (as easily) with array indices that start at 1. It's not a trivial argument.
Similar with white space; having to write code which obeys white space and tab rules is not the way some people like to think. As much as I love Python (and I do), I find it more restrictive and less fun than Ruby. It's not just superficial, it changes the way you think, and what you think about. Of course Python has its advantages, lots of them. But it also has its own style, which may not be everyone's song and dance.
I do program in both Python and Ruby frequently, and I have to say that it has nothing to do with experience or comfort, it's truly a judgement, and a valid one at that. Nice try :)
http://www.secnetix.de/olli/Python/block_indentation.hawk
Summary: Python's whitespace usage is nothing like Make's.
Most of the good developers I know have their preferences for sure, but can be productive in all sorts of languages.
So you've never even tried it? If you like YAML, SASS or CoffeeScript, you would like Python's indentation syntax too.
I think it's lovely and elegant, and that meaningful indentation should be used more. It obviates a lot of cruft and makes things clearer and more concise. What's not to love?
Seriously, it's kind of dumb if proudly holding on to your prejudices is preventing you from enjoying a lovely programming language.
The only way Ruby becomes irrelevant is if a new paradigm becomes dominant that just isn't easy to implement in Ruby. Threaded/evented/asynchronous frameworks do fit the bill, but my sense is that enough people prefer Ruby so much to a language like Javascript (in the case of Node), that if something like web sockets become indispensable as an 80% use-case, then the Ruby community will figure out how to make it easier to use them. I'm still using MRI which has some difficult problems to solve, but it seems JRuby is pretty much ready to pick up the slack if it really becomes necessary.
I think most of the things you say sound like you haven't worked with either.
Few people are moving to pure JS front-end. Some are, some write blogposts about it, but the majority of people isn't. Some are even moving back, a year or so ago there were a lot of blogposts about that kind of stuff.
Rails offers a lot of interesting things in the M and C parts of the MVC pattern (Object persistence, REST endpoints, ...). People even write books about the topic ( https://learn.thoughtbot.com/products/1-backbone-js-on-rails )
Ruby and Python are pretty similar and as with Java and C++, there is space for both. I personally like Ruby more, but I guess that's just a matter of style.
I'm more worried about Javascript. Unlike Ruby, which has genuine advantages separate from Rails, Javascript is almost entirely propped up by its status as the only language available for DOM manipulation. Once it loses that footing, it's not a very viable language in and of itself.
I agree with this but I think there is a place for a javascript framework tied fairly closely to Rails. Possibly ember.js since the attitude towards both seems similarly opinionated and Yehuda Katz is one of the ember team. The Rails API gem accommodates this quite nicely as well although one of the benefits of Rails' modular design is that you can lose lots of the stuff you don't need if you are only building a REST API. Maybe this is the future of Rails?
I find that the ruby community tends to be fairly vibrant, passionate and innovative. I think the language lends itself to a creative way of thinking, and that shows in the projects that are created in it.
Blocks are amazing, and really clean up code for what is a very common usage pattern. I'm semi-offended by python because of the lack of what I deem to be an elegant equivalent. Not as offended as I am by perl or java, but I used to like those languages too. I detest the python string interpolation syntax - #{} is so much nicer. And I suspect that for other people these choices matter too.
Why weren't things like Sinatra, Sass, Less, Jekyll, Metasploit and Rails invented on another language? Other languages would be adequate for the task as you put it. Github is arguably the biggest thing to happen to open source in recent years.
As far as JS front ends/Rails go, I think we could get there one day and there are tradeoffs but you have a few problems with the model you propose; 1) Javascript sucks as a language 2) Server side rendering is always going to give you more control 3) accessibility is easier if you have a server side fallback.
"Best Practice" has always switched between centralised and decentralised throughout the history of IT. With Rails you can do both.
but more than any of that, ruby is simply the most productive language i've encountered for performing quick one-off tasks and exploring algorithms. it has all the strengths of perl (another language that plays very well in this particular niche), and adds very natural support for both object-oriented and functional approaches. i've used lots of languages (everything from basic to haskell) and ruby is almost unique in that i have never felt like i was fighting with the language to put my ideas into code. i think of the way i'd like to say something, and sure enough, ruby supports it and more often than not makes it easy and natural.
Of the three I think Ruby is the better language. I still like Perl though, so what do I know. :-)
I beg to differ, though I'm biased. Rails still offers a lot. https://github.com/rails-api/rails-api#why-use-rails-for-jso...
That's true for virtually anything. Do you think C/C++ or Java or JS will be mainstream 30 years from now. They will be in the same situation FORTRAN is today: important because of lots of legacy code, but not a viable choice when starting a new project.
Of course some of them will never die. LISP comes to my mind. :-)
Essentially every important piece of software today, from operating systems to programming language implementations to server software to applications, is written in one or both of them. All of these systems are not just going to go away.
C is over 40 years old, and C++ around 30, yet in that time nothing has come along that can compete with them. Some other languages have tried, but their success has only ever been partial, and typically in just one or two specific domains.
People still write new code these days in Fortran for scientific computation. Fortran compilers are still markedly better at optimizing numerics, multi-dimensional arrays, etc, partially because of the effort invested in the compilers and partially because the language is easier to optimize.
It's definitely a niche language.
Or, to put it another way, LISP was never alive to begin with.
If Ruby/Python had a community and third party libraries the size of LISP we would consider them mostly irrelevant languages.
And apparently "we" are using "irrelevant" to mean not fashionable. Or does it mean, "Do not use for new IT projects" or something? What does it matter what other people do, especially those with a strong (if small) community, frameworks, libraries, books, articles, conferences...
And where does Smalltalk fall? I hate to tell those people their language is "irrelevant" -- will their programs crash? And which LISP, by the way?
This irrelevance property is dumber than a language debate because we don't even debate them, we condemn them from the outside by applying our own arbitrary criteria. Why do we need to belittle the work of others? Maybe we are not as sure as we appear.
$ ruby --version
ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-darwin12.2.1]
$ time ruby pidigits.rb 10000 2>&1 > /dev/null
17.51s user 0.11s system 99% cpu 17.639 total
$ ruby --version
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.1]
$ time ruby pidigits.rb 10000 2>&1 > /dev/null
4.64s user 0.27s system 99% cpu 4.927 total
That's a significant difference in speed. Going from 17.51 seconds to 4.64 seconds
1.9.3-p194: 11.8s
1.9.3-p385: 9.9s
2.0.0-rc2: 6.1s!
Tests were done with `time bundle exec rake environment` 5 times, dropping the highest and lowest and getting the mean of the rest (lazy snow day benchmarking). Very exciting!
I'm hopeful and expecting the switch to 2.0 by 80% of Rubyists in 2013.
Compared to the adoption of major version releases by Python/Java/C#/PHP, I think that's something the Ruby core release team can be proud of.
I think they've learned from that, as 2.0 looks like a much cleaner/easier transition.
We'll see how 2.1 goes, I guess.
Keyword arguments, which give flexibility to API design
This looks good to replace all those options hashes in rails for example, though I wish they'd made it an all or nothing thing, apparently you can still do this:
def foo(x, str: "foo", num: 424242)
i.e. use some named and some unnamed in the same method which looks ugly.Module#prepend, which is a new way to extend a class
Compared to something like Go, I do worry the Ruby inheritance picture is becoming overly complex, but I guess there must have been some use case for this - anyone know where it is going to be used?
__dir__, which returns the dirname of the file currently being executed
This is a great little enhancement which means I can replace File.dirname(__FILE__) from the start of a lot of utility scripts. Would love to have seen more little improvements like this.
The UTF-8 default encoding, which make many magic comments omissible
At last! This should have been in 1.9.
Performance improvements
While these are incremental, it's nice to see more improvements - thanks Ruby team!
Onigmo, which is a new regexp engine (a fork of Oniguruma)
Not sure what this changes from Oniguruma.
Refinements
Refinements seems to be the headline feature for a lot of people, but I have two hesitations about it: it's encouraging a practice which has come to be seen as one of the most dangerous parts of Ruby - monkey patching, and the process of deciding its inclusion seems to have brought about a few schisms with the community developing alternative Ruby implementations because of performance implications, and raised wider issues about the Ruby design process:
http://www.confreaks.com/videos/1278-rubyconf2012-toward-a-d...
There is the argument of course that it's attempting to limit monkey patching and therefore limit the damage caused, but should it be encouraged at all? It'd be interesting to hear more on what happened here from anyone has been following this closely.
protagonist.throw(potato, :force => 3, :at => zombie)
In this case a call to :throw without an object to throw is nonsense. Throw is a transitive verb, and the parameter is implied. On a throw method, the parameter is obviously the thing being throw'ed.On the other hand, the optional parameters are totally obscure, and need to be named.
Similarly:
justice.join_in_matrimony(jay, bob)
The two unnamed parameters here are the things being join_in_matrimony'ed.In other words: unnamed parameters are for direct objects, named parameters are for adjectives and prepositions.
Although arguably the Rubyish thing to do with prepositions is chain them:
protagonist.throw(potato, force: 3).at(zombie) protagonist.throw(a: => potato, :at => zombie, :force => 3)
which would be just as nice. But I'm sure there are places where this will be useful/necessary, in your chained example with single args it feels forced to have to name them.Refinements, on the other hand, looks brain-damaged to me. I see the rationale, but the outcome looks more complicated and error-prone than the situation it is trying to address...
And it looks like the type of thing that will "infect" other code, just like C++ code for a while got infections of throw specifications on member functions, that then got propagated all over the place and cause major pain every time you tried to modify code. Until most people stopped using them much again except in very limited circumstances.
Re refinements I agree and find it worrying that it was added given the widespread objections.
Looks like Module#prepend is there to do a similar thing.
For example, say I have a class that can process stuff, and a mixin that attempts to log calls to the #process method:
class Processor
def process
puts "Very important stuff here"
end
end
module Logger
def process
puts "Entering process."
super
puts "Leaving process."
end
end
If you just ``include Logger`` in Processor it won't work: Processor#process is looked up before Logger#process. However, if you use Module#prepend, the ancestry chain will change and calls to Process#process will be decorated as expected."I know someone who is working on a Ruby implementation and making very good strides and is not talking about it publicly at all--and I think you'll be surprised when you find out about it."
Is Brian Ford talking about Topaz [1]?
[1] http://docs.topazruby.com/en/latest/blog/announcing-topaz/
"The UTF-8 default encoding, which make many magic comments omissible"
because i'm from Germany and we had to add: # coding: utf-8
in every freaking controller to get our german stupid letters (öäüß) to run without problems.
so i'm looking forward to my next project where i can use 2.0 from the scratch.
thank u!
We are Danish, and are writing comments in English, and all locale strings is placed in i18n-files.
I once discussed the phenomenon that is precisely communities with adjoining territories, and related to each other in other ways as well, who are engaged in constant feuds and in ridiculing each other -- like the Spaniards and Portuguese, for instance, the North Germans and South Germans, the English and Scotch, and so on. I gave this phenomenon the name of "the narcissism of minor differences", a name which does not do much to explain it. We can now see that it is a convenient and relatively harmless satisfaction of the inclination to aggression, by means of which cohesion between the members of the community is made easier. -- Sigmund Freud, Civilization and its Discontents
Look at Hibernate. As of the last time I used it (admittedly, several years ago), it was almost impossible to run raw queries against the underlaying database and get back simple result sets as arrays of tuples. You had either the abstraction, or nothing.
With ActiveRecord, you can at least get at the underlaying database connection via select_all and select_values, and turn Relations into SQL queries via '#to_sql'. It's not perfect by any stretch, and for some reason I don't understand Arel decided that being able to OR two queries together wasn't important, but you can leave the abstraction when you need to.
(Mongoid, the MongoDB ORM, is actually really well-designed in this regard; the Mongoid::Criteria works like Arel should, as does Sequel...)
ActiveRelation is very similar to the criteria api, but it still uses string parsign.
HQL is awesome.
That said, I haven't done Java for 3 years and am a 100% rubyist (and some lua)
The developments of rails are good. But they are simply all the stuff that maturing platforms will need. Rails is becoming JEE, but in a more developer friendly way. This is a good thing.
When I think of "Python", I think of a mature, helpful, experienced, talented, well-educated community. I can generally trust their advice, I can trust their code, and I can trust their technical decisions. It feels like collaboration is important and encouraged.
The Ruby community, whether this is deserved or not, leaves a very different impression. Anything good is quickly and heavily overshadowed by the unnecessary and petty drama, the egos, the fixation on worshiping certain figures in the community (DHH, Zed, why the lucky stiff), poor technical decisions, inexperience, repeated displays of very immature conference behavior, and so forth.
In can reflect very poorly upon a language when the community is generally toxic, like in the case of Ruby, or very positively when the community is generally superb, like in the case of Python. This is true even when the languages themselves are rather similar, from a technical perspective.
I'm a Rubyist, and I've found that the vast majority of the community, events, interactions, etc are smart and civil. Yes, the Ruby community does have a bit of a publicity problem, but that's just the noisy/stupid minority.
Perhaps this is a common issue more broadly. (Are all PHP developers stupid? Are all lawyers money-hungry scum? Do politicians have no regard for intelligent discourse?) Our media (whether that be mainstream or Twitter and HN) is great at highlighting the controversy, but not a good source for a deeper understanding of the lay of the land.
Any community will have stratas of personality types that exist in various proportions:
* The loudmouth alpha types (DHH, Zed)
* The playful jesters (_why, Tom Preston-Warner) who are often evangelists
* The sharp-minded, code-focusing engineer types code (lots!)
* The newbies (lots, too!)
The Ruby community has been perceived as blighted with in-fighting, but it is, in my opinion, rather a case of certain people, the first type, trying to be public leaders, and failing at it. Those big sounds are just ill-considered publicity stunts. It's clear that DHH wants to be the Linus Torvalds of the Ruby community, blasting his way through perceived idiocy with profanity-filled speeches appealing to common sense and good engineering. Zed seems to want to be Jamie Zawinsky. Leadership does not come from being loud.
Ruby has its share of the playful and weird. Sometimes they give the impression of hyping something, because they bring with them their rosy-tinted version of the world where everything is fun and great. Sometimes they come across as glib and obnoxious because, well, they are, a bit. Overall I think they are an asset.
These two types are the people you encounter if you follow blogs and tweets, precisely because those two personality types depend on publicity. The Ruby community will certainly seem overrepresented by idiots if you go that route. But if you go on the Ruby mailing list you will see a different community, one that looks more like the Python people. Matz and many other core devs are conservative, highly technical, mature, and very helpful. There are also many low-visibility sub-communities that are very professional. My local Ruby meetup community in Oslo [1] is a wonderful bunch of highly technical, development-focused people who have none of the negative traits you describe. And if you go back to the question of what a community is supposed to provide -- help, insight, direction, ideas -- there are tons of great people.
That said, do I think the proportion of highly-skilled, high-technical is somewhat smaller in the Ruby community than the Python community? I do. Python has gained acceptance in more conservative, engineering/science/maths-oriented environments where Ruby has not yet reached, partly because of tools like SciPy. In fact, my feeling is that Python seems generally to attract a higher proportion of "engineer types" who are attracted by Python's rigidity (one way of doing things, etc.), compared to Ruby's often extreme malleability and laxness. This also means that the Ruby community is potentially missing out on some hard-core devs, and without support from the engineering/science/maths sphere it's never going to get things like SciPy.
And as for the newbies, Ruby has perhaps a bigger than usual share of inexperienced devs who are pollute the library space with lower-quality code. I blame this on the fact that Ruby is so simple to learn and has attacted many people through Rails, and this gives some devs a false feeling of confidence. I have had my share of time spent wading through other people's bug-ridden, ill-architected Ruby gems, but then if anything it's taught me to be careful.
[1] http://irb.no/
These result in two very expressive and potent languages with many similarities and with a lot of the best ideas of modern programming languages included (pure functions, lambdas, list comprehensions, etc.) but with fundamentally different core "belief systems" and zeitgeists.
Ruby is very, very much a "there's more than one way to do it" language, while Python utterly rejects that and adopts the "there should be one, and preferably only one, obvious way to do it" philosophy.
[1]: Obviously this is a very slap-dash comparison which isn't meant to be taken 100% at face value and is merely meant as a way to help illuminate the ideological differences between Ruby and Python, it's not an invitation to start a flame war.
Neither python nor ruby have any special support for pure functions, I suppose you could use some sort of decorator marking pure functions which one of those python subset compilers(or pypy) could use for performance optimization but I'm not aware of anything like this happening right now.
Also I don't think ruby supports list comprehensions it supports oo styled higher order functions, c# without the special syntax does the same thing. You may argue this is just a syntax but list comprehensions are just syntax that , you can rewrite them with nested for loops and appends(yields in the case of generator expressions)
I think in many although not all ways ruby is more of a smalltalk(but more practical).
Python doesn't exactly have an exact idealogical parent, although it has ABC as a historical parent(http://en.wikipedia.org/wiki/ABC_%28programming_language%29). Python outside of core imperative freeform do your own thing, want to write a oo based solution sure, want to write large imperative functions, go ahead, want to use modules to organize those go ahead. Want to use named function arguments or kwargs or objects or dictionary args go ahead. You can choose to use itertools, or your own yielding functions, or generator expressions sure.
Edit: I think I mean the communities are far apart.
I stay away from Python because it is similar enough to not give me any great benefits over Ruby, while it has some warts (to me) such as the whitespace handling, that makes it uninteresting because it is so similar that the payoff in accepting what I consider warts is too small to warrant it.
I'd have been a lot more willing to ignore the things I don't like about Python if the differences in other areas were major.
Meh, I use Ruby for most of my work (day and side projects) but have nothing against Python. If I was writing a script for something on the OS I'd probably use Python.
Some people just really want to feel part of a group, I guess, and publicly dissing "the other" makes them feel more included in that group, or something. As for me, I like to feel like part of a group too, but it's a more inclusive "programming" group, rather than focussing on any one particular toolchain.
It's their very similarity that gives rise to the strong feeling. René Girard's theory of mimetic rivalry sheds light on this.
Edit: Alternatively, http://en.wikipedia.org/wiki/Narcissism_of_small_differences
Python - is "executable pseudoscript". It does not have ruby elegance, perl "worse is better", javascript ... minimalism(?)
I'm using python for prototyping. As communication tool.
I can describe all python scetches to every programmer, be it javer, c-sharper, C-developer or SQL-er.
Can I use perl/ruby/CSharp/Java/F#/Haskel?
Answer is NO.
Perl: sigils, regexp everywhere (when it not needed), parameters passing, "use strict", strange OOP - all those features makes it impossible for prototyping.
Ruby: it's the same as for perl. It looks more pleasant to eyes but it is no way "pseudocode" that everybody can read.
C#/Java - prototyping is a joke. And I can't use sharp-code for javer and otherway.
F# - F# is looking a lot like "pseudo-script". But the main strength - type system is not helping in prototyping.
LISPs - I think that LISPs are good for prototyping. The only problem - they are LISPs.
> Ruby: it's the same as for perl
Nothing you said about Perl can be applied to Ruby.
You need to explain that 0 is True.
You need to explain blocks, (int_number).times and other cute things.
And I heard a lot of complains for whitespace, but begin-end is more irritable for many.
It's very relevant, and very active.
Every commit is a release of rbx. Yay continuous integration!
That said, there hasn't been a numbered release in a while, through there will be a 2.0.
The Rubinius 2.0 preview release came out in June 2011: http://rubini.us/2011/06/07/inside-rubinius-20-preview/
EDIT: Just checked. If you `rvm install rbx`, you get code written today.
What is the best way to let Ruby team know that refinements are a bad idea?
Get involved in the discussions on ruby-core.
I spent a little time looking at Ruby in the past. It seems like a nicely designed, clean language. However, it seems to me that it lost to Python in many domains. In addition, I've heard stories about Ruby having performance problems. For example, I heard Twitter rewrote their backend in Java/Scala because Ruby didn't perform well enough.
Recently I was at a Cloud Computing symposium thing attended by academics and industrial developers. No-one in the room was using Ruby for development anymore. Has it died? Is there any point learning it?
Don't worry too much about what you hear about performance. If you are building a Twitter, then yes, it might matter what language you're learning. Ruby, Python, and PHP tend to be in the same ballpark in terms of performance, with each having their own warts.
As of late, I've been most interested in golang.org. You can learn the basics in an afternoon at tour.golang.org.
myFunction(something, 23,23,100, somethingElse, true)
People should write smaller, more specialized functions instead (less arguments). That makes software both: more efficient and more maintainable.
If you start thinking: "Damn I wish I had keyword arguments to make this function call more comprehensible!" .. the problem is elsewhere.
Most languages:
someObject.throwProduce(apple, myEnemy, 14, 17);
Objective-C: [someObject throwProduce:apple at:myEnemy withForceInN:14.0 maxDisanceInM:17.0];
As long as you name the function appropriately, it's clear what each parameter does without having to look up the name. Many people complain about the long names (in this case throwProduce:at:withForceInN:maxDistanceInM:thenWaitInMS:), but it avoids the situation you have in other languages where there are 4 functions with the same name but different signatures. In Obj-C the naming conventions discourage such ambiguity and encourage self-documenting names.Why people still use Ruby?
1. Because they get dream day rates for maintaining rusty slow legacy systems
2. Because they do not want to learn new languages and can stay in their comfort zone
3. Because they think it's still 2005 and nobody cares about slow server response times
And now Ruby lovers, click on downvote or give your reasons why you still use Ruby.
1. Probably 75% of new startups are using rails, and rightly so. You'd need a good reason not to use it. "Rusty slow legacy systems" - what nonsense.
2. If there was a better language, they'd probably learn it? Or are you trying to insinuate Ruby programmers are dumb/lazy?
3. If you are blaming your slow web page on Ruby, you're doing it wrong.
75%? Evidence? You are the one who is talking nonsense, sorry to be direct and getting on Reddit level but you started.
> 2. If there was a better language, they'd probably learn it? Or are you trying to insinuate Ruby programmers are dumb/lazy?
Do I really have to tell you? Instead of doing some research Rubyists still defend their old tech (like you do now).
> 3. If you are blaming your slow web page on Ruby, you're doing it wrong.
Yes you are right, and now get back in your comfort zone and code some slow web services.
I agree with tferris to some extent. Those arguments are nonsensical to say the least.
This might be a feeling, I am not one to shout random feeling-based percentages, but I feel that people, in general, not just HN, don't realise that you can just claim things in this way. 75%? Where does that come from?
Also, the second argument is complete rubbish. By this logic anything that the masses do is better? So Earth was flat at some point in time? And yes, I think that people ARE lazy, as we should be, why use a framework otherwise? But some people are just stuck in the before mentioned comfort zone. Evidence is the popularity of Rails clones in PHP (or at least attempts at). Why not just learn Ruby and use Rails? => Fear of learning new programming languages and being new at something?
Third argument is right to a certain extent. If you need to invest a lot of trouble to make some slow code (which Ruby tends to be) faster, at what point do you choose to just use something faster? Where is the line; break even point?
I use Ruby at the moment too, but you have to remain critical and even more so, you need to reflect on your own ways of reasoning.
None really, just the startups at an incubator-type place near me. Might not be 75% but it's certainly a big chunk and probably the majority.
Why? I am damn serious about every point: Ruby/its entire ecosystem/Rails/DHH is outdated/becoming obsolete/so 2005.
Your original post, and every one since (including the multiple sets of edits you apply to each), consist of nothing but a daisy chain of mud slinging and ad-hominem attacks directed at other commenters.
You're a troll, plain and simple. Sorry for feeding you, but I simply think it's sad this unproductive rant has completely derailed the entire discussion here.
There are some things I wouldn't do with Ruby here. Like some concurrent background jobs; better solution would be Clojure, Erlang or any language where the concurrency constructs are better thought and easier to manage. Although we're having threaded Ruby running, it's not very elegant and you can do pretty nasty bugs in there.
I'd very much like to learn the next great framework and its language - I just haven't been convinced by any of the front-runners quite yet (especially in terms of ecosystem resources). When that happens, you can bet many coders like me will jump on it. Till then we'll just continue to work on our Rails apps.
I am not into Java but I'd rather prefer using Java the next 10 years than Ruby 1 month. At least I get a perfect language implementation (the JVM) with Java.
I don't agree with you about the JVM, but you're clearly ignorant of Ruby if you're not aware that there's a Ruby implementation that runs on the JVM (JRuby).
Disclaimer: I am not a Ruby programmer.
While Dart could be good for the server-side too, as it's VM will be as fast as any other dynamic language VM out there and the language is still quite cool, on the server-side we get to choose the tools more freely so there are many options.
Then again, why would people use Dart or Ruby on the server-side if they could use Go instead?
Go and languages like it are more lower level and sometimes more demanding, making mixing and matching while programming harder.
Mixing and matching is a way of programming for today rather than for the future. Say, dealing with the issues as they present themselves rather than trying to go around them. Say, dealing with the UI as they are popular rather than doing things in an unusual way while trying to guess the future.
I really liked watching an Intel guy say that if your approach to parallelism isn't about sharing the load to over a hundred threads, then forget about guessing the future.
For now as in the past, people have been successfully using threads for doing what they were originally meant for as Guido Van Rossum explained in a recent video. Threads were meant for concurrent I/O work. Now people want to push them to doing more parallelism. Not sure how we are going to get there.
Because like supporting many GUI front-ends has taught us, getting the most out of GUI often means that you need to target them on a one-to-one basis. Creating programs that support 1 thread or 100 threads from the same codebase will be quite a challenge going forward. Because if you want most performance from just 1 thread, it could be that the program needed to be written one way. Whereas to make it better for 100+ threads, it could need to be written a different way.
So, why would people write Ruby? Because it works. The Internet is unreliable anyways. Depending on a central server is too all-eggs-in-the-same-basket for the Internet.
Also Ruby is getting more stable. Depending on new tech can lead you to unstable nightmares.
If you were worried about bigger codebases and still wanted a language like Ruby, I'd first recommend Dart than Go. But for its current stability concerns. It will hit 1.0 soon though.
I am a fan of Ruby in big part because of how it handles objects. In Ruby, everything is an object. Objects' only public interface is their methods. These methods don't require a pair of parenthesis to call them, so you can call them as you would access a public variable in other languages. You can easily set up getter/setter methods for an instance variable via an "attr_accessor :instance_variable" call within the class definition, or you can define its "instance_variable" and "instance_variable=" methods yourself.
This combination of things is I think Ruby's killer feature and makes for a very elegant workflow. You should give Ruby a chance :)
(I think we are both coming from that it really doesn't matter most of the time side but would be interesting to know if PHP is actually slower).
But ~300ms server response times is nothing if your end user has to wait 5-6 seconds for the page to render due to suboptimal frontend code. Plus, throw in varnish/nginx microcaching and requests drop to ~10ms regardless of your framework.
Yes, the VM itself is not fast. However, a lot of it is just a thin shim over a C call, so whether you're going to be bottlenecked by it is going to depend on what you're doing.
* Everything is an object, without exception.
* The object model is pleasingly orthogonal and its behaviour is easy to understand and predict once you know how it works.
* The syntax is high on alphanumerics and low on punctuation.
* Most of the core library method names strike a good balance between brevity and clarity.
* `Enumerable` is simple and powerful.
Plenty of people criticize Notch for using Java in all of his games, but Notch gets things done. It's hard to ridicule someone making so many useful things (well you can, but most end up looking like jerks lacking tact). Might not be in the coolest or most efficient language, but the results speak for themselves.
People use x language because x gets things done for them, their business and it shows results. People that spend much of their day thinking about how they dislike a particular language and its users generally are not the ones being productive with their more enlightened language(s) of choice.
I've been implementing a compiler in Java (not my original decision, but I don't think it was a bad one) and, although its frustrating at times knowing that some list transformation would be a one-liner in other languages but five lines of Java, it hasn't actually proven to be a drag on productivity. You have automatic memory management, a reasonable selection of basic collections, a reasonable selection of abstraction mechanisms, the ability to implement things like immutable classes, etc, so there aren't any major obstacles to productivity.
A lot of times when writing new code I wish I had builtin tagged unions, since I have to do it manually with a class and an enum. But once I've actually implemented a tagged union, I don't find that future additions and maintenance work on the code actually take any extra time.
I still look at new developments, and toy with new technology and programming languages, but when I want to get shit done, I find there's little that defeats using plain "old" C, Ruby, Java or whatever else you would probably call outdated.
Ruby itself is quite flexible and easy to use although it does have quirks.
But yes, ruby is hellishly slow. I have not enough experience to speak about the legacy systems, though it would interest me to know about that. You do hear a lot of stories about switching from Ruby to Scala/Java/Clojure.
And in my kind of web applications I handle massive load via HTTP Caching, leaving your "fast" language without cache-aware architecture far behind, thank you very much.
And in my experience, devs who focus so much on the "fast language" part, do so, because they don't actually know much about caching. And no, this statement is not universally qualified.
Maybe you are right but I am just fed up that on HN the forefront of new tech still such old slow technology gets upvoted on a regular base mostly by people fearing their go to tech is vanishing away. Ruby/DHH/its entire opinionated ecosystem is so 2005.
So you have no actual quantifiable arguments and resort to this and ad hominem attacks on people that use a programming language? Not the best way to make your case.
I believe that Ruby was born in the first place with a kind of a sentiment of not wanting at all to become the speed optimization guy if that ever means sacrificing the part in itself that allows for so much freedom and creativity! And I guess this is exactly how the community around it feels it.
You get the good milliseconds stats, plus money.
A Rubyist might respond with a bunch of more ms. here and there(for now); he gets the same money; he has much more fun.
Is it so hard to understand ?
Do you still enjoy programming like you did in the first days? If not, take a look at Ruby, seriously :)
Probably, better Ruby performance will come with time, but if Ruby will fail in the long term, then it will happen just because of a new more performant, but equally (or more) fun/smart language.
In conclusion I think that Ruby has the merit of having woken up the feeling that programming can always be as fun as the first days and.. that it doesn't have to transform you into a sad, dissociative geeky looking person anymore.. :P
No offense intended!.. :)
Ruby truly is the Apple of the programming world.
I don't see how Python can be objectively better than Ruby.
I don't know enough about Lua to comment.
Maybe you should think long and hard about why exactly Ruby (and Apple for that matter) makes you so mad that even though you don't use it or program with it, you have to come here on an article about a new release just to spit some venom even though the language itself doesn't impact your personal life in the slightest.
No fucking way.