Live data from Hacker News

Ruby 2.0.0 Released

ruby-lang.org

171–180 of 303 posts

Re: Ruby 2.0.0 Released

#171

Earlier quoted context omitted.

> Of course some of them will never die. LISP comes to my mind. :-) 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.

> ...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 "irr…

>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...

It matters because there is not enough of "community, frameworks, libraries, books, articles, conferences". If I want to do something in LISP there are 2-3 libraries in different states of broken and/or abandoned. In Python I can usually find something with much more ease. In Java even more so. The same for hiring programmers AND getting hired yourself, etc etc.

>And where does Smalltalk fall? I hate to tell those people their language is "irrelevant" -- will their programs crash?

You don't have to tell them. They know it already. It has been ever since most Smalltalk shops closed and the bigger ones turned over to supporting Java.

Now, people using Smalltalk to do hobby work, or even nice important work with paying customers, good for them.

Their programs will not crash (unless their Smalltalk platform of choice gets abandoned to die with too few contributors or is proprietary and doesn't get support for newer platforms and architectures). But they wont be getting as much new toys as the other boys.

>And which LISP, by the way?

All of them, inc. Common Lisp. Clojure might have a fighting chance, but it still is too small for people who value ecosystem over cowboy style "let's build all the wheels ourselves".

>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.

Irrelevant? It's very pragmatic. Number of available employers, employees, number of documentation, vibrancy of the ecosystem, new libraries and continuous support for older libraries, etc.

I would love to have a Smalltalk that is well supported to play with. One that is not aimed at kids and doesn't have a Fisher Price UI like Squeeze, and that can match Python or Java for ecosystem. Unfortunately none exists.

Re: Ruby 2.0.0 Released

#172
post #80
post #49

Overall, a good feature set. I only see some utility for keyword arguments, admittedly, but I tend to write very functional code, so maybe other people will get more mileage. 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…

Have they removed any features?

No, 2.0.0 is intended to be mostly backwards compatible with 1.9.3.

Re: Ruby 2.0.0 Released

#173

I do wonder about the long term success of Ruby. Rails is easily the most visible project for Ruby. Rails is big, and all that code represents a high barrier to entry for any framework in a different language that wants to compete. However, a lot of people I talk to are moving to pure JS front-end + REST backend. In this world Rails doesn't deliver any particular value (in my opinion). Ruby also has utility for doing…

>However, a lot of people I talk to are moving to pure JS front-end + REST backend. In this world Rails doesn't deliver any particular value (in my opinion). 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 qu…

I maintain rails-api, and both Yehuda and I have commit to Rails. I just want to mention that while Ember + Rails will be a potent combo, Ember will work great with non-Rails backends as well, and rails-api will work great with other frameworks too. That said, we're working really hard to make sure that Rails 4 + rails-api + Ember 1.0 is a fantastic experience, so watch that space for sure.

Re: Ruby 2.0.0 Released

#174
post #153
post #111

Earlier quoted context omitted.

As a Ruby user that finds Rails annoying and not something I like working with, I don't think that's all that relevant. A lot of people have come to Ruby because of Rails, but a lot of Ruby people dislike Rails too. There's a plethora of web frameworks for Ruby that have sprung up exactly because of people who want to use Ruby but don't like Rails. In terms for barrier to entry with Python, the issue is that a lot of…

You seriously would turn down a good job or other opportunity if the only downside was having to write in a whitespace-sensitive language? Most of the good developers I know have their preferences for sure, but can be productive in all sorts of languages.

There are plenty of other good jobs that don't require Python. He has already said others like it but it doesn't work for him personally. Why beat it over his head for your preference?

Re: Ruby 2.0.0 Released

#175

Anyone have any thoughts on why python and ruby are so similar, yet so far apart? They are obviously very close, because people switch between them all the time. And they are compared on everything (languages features, libraries, tooling...). I think it's a healthy competitive environment.

I think that ruby, perl, python and javascript are similar only in purely theoretical way.

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.

Re: Ruby 2.0.0 Released

#176
post #126

There are some nice features here: 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 Comp…

Module#prepend doesn't look too bad from me from a complexity perspective - inheritance in Ruby boils down to two parallel trees: One of the inheritance chains, and one of the method lookups. Really we're dealing with a single tree of "actual" inheritance, with some of them being "hidden" in some contexts. It gets a bit complex if you want to do meta-programming or do something that depends on the inheritance hierarc…

There was a post here a while ago about a language that didn't use 'super' inside subclassed methods, but instead had something used in the parent class method to call the same one in any subclass. I quite liked the idea of that.

Looks like Module#prepend is there to do a similar thing.

Re: Ruby 2.0.0 Released

#177

I do wonder about the long term success of Ruby. Rails is easily the most visible project for Ruby. Rails is big, and all that code represents a high barrier to entry for any framework in a different language that wants to compete. However, a lot of people I talk to are moving to pure JS front-end + REST backend. In this world Rails doesn't deliver any particular value (in my opinion). Ruby also has utility for doing…

> In this world Rails doesn't deliver any particular value (in my opinion).

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...

Re: Ruby 2.0.0 Released

#178
post #5

This is pretty exciting. Might be too early to tell, but it feels like the Ruby versioning recently has been done very right. The switch from 1.8.x to 1.9.x was slightly painful, but I think 80% of Rubyists have made the jump. 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…

Rails 4 will ship with "1.9.3 required, 2.0.0 recommended," so I'm expecting that to drive a lot of adoption.

Re: Ruby 2.0.0 Released

#179
post #68

Earlier quoted context omitted.

The unfortunate thing is that there really isn't a tradeoff if you build your elegant and simple DSL on top of a set of API primitives that give you access to low-level behavior. 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 abstractio…

Sorry, but Hibernate has been far superior to ActiveRecord from day one. 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.…

> it still uses string parsign

This is false, at least after tenderlove did all his work to re-write arel.

Re: Ruby 2.0.0 Released

#180
post #152

Earlier quoted context omitted.

You see, you wrote a bunch about how len is so cool in Python. But in the face of dynamic typing and polymorphism I didn't expect it to be any different really. Languages like Go that are statically typed make more of an issue about interfaces. Even in Dart they dropped explicit Interface usage in favor of implicit interfaces, considering that Dart is more explicit about matters than Ruby is. Switching those function…

I don't get the last part... in python a class is written as class InPython: def aMethod(self): pass but... what I'm missing? I can't follow the reasoning... regarding the C extensions... I didn't really needed to write one, but from http://docs.python.org/3/extending/extending.html#a-simple-e... I see static PyObject * spam_system(PyObject *self, PyObject *args) ... so I assume also on C level the python objects are…

Exactly. In Python you still pass "self" to the method. In Ruby and Dart it's not needed.

In Python I've seen Python users discourage the use of classes. I haven't seen the same distrust of classes in Ruby for instance. It's as though Python has unresolved OO issues. Python could take pride in being "multi-paradigm", whereas languages like Ruby and Dart could take pride in being more OO.

Regarding the C extensions of Ruby, I think the bottomline is that from int, to booleans, to null, to classes, everything is considered OO even in the C code. So common functions can be applied to them even from C, say like Polymorphism would in other languages. From the primitives on up everything is like a high level Ruby. As Python is more "multi-paradigm" perhaps some of its C extension features aren't as OO as Ruby's are.

Funny though that those C extensions that make Python and Ruby so popular end up making other implementations of those languages that target other runtimes incompatible as they don't have access to those C extensions. So even in that regard they are similar.

Say we can't find anywhere in Python where Objects don't exist. Then welcome on board of true OO. Now show OO some love and stop discouraging the using of classes. Maybe drop the "multi-paradigm" approach. I know though that like JavaScript, sometimes you have to live with the shortcomings of the programming language in its support of OO. So while JavaScript could be said to have Objects everywhere, and it truly does, writing classes in JavaScript is not a settled issue. That's why I like Dart instead:

  class A {
    var aList = ['a', 'aa'];
    get length => aList.length; 
  }
  
  class B {
    var aList = ['b', 'bb', 'bbb'];
    get length => aList.length; 
  }
  
  class C extends A {
    var aList = ['c', 'cc', 'ccc', 'cccc'];
  }
  
  printIt(o) {
    print("${o.aList}: ${o.length}");
  }
  
  void main() {
    printIt(new A());
    printIt(new B());
    printIt(new C());
  }
Result of running it:

  [a, aa]: 2
  [b, bb, bbb]: 3
  [c, cc, ccc, cccc]: 4
Post reply on HN