Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Notable Features:

  - Named arguments
  - Multiple inheritance (traits)
  - Incremental performance improvements over 1.9's VM
  - Better compatibility with non-unix environments and small/constrained devices (embeddable)
  - Sandboxed VM's (VM per thread)


There is no multiple inheritance in ruby 2.0, there are mixins (like traits) tough, but they have being in ruby since I can remember.

Also, there won't be MVM (Sandboxed VMs) on this release.


Ruby 2.0 was (and hopefully still) earmarked to have traits which are an enhancement on mixins providing a much better & refined compositional implementation.

Thus it (should) allow you to do things like excluding or renaming methods/traits ala Perl roles - https://metacpan.org/module/Moose::Manual::Roles#METHOD-EXCL...


Refinements will be at the 2.0 release but I wouldn't call that feature "multiple inheritance".


Neither would I because refinements are something completely different to traits!

Refinements proposed in Ruby 2.0 allows you to localise monkey-patching much like you can do in Perl with dynamic scoping (for e.g.: http://news.ycombinator.com/item?id=1603321 | http://news.ycombinator.com/item?id=3455507). For further info on Ruby refinements see here: http://timelessrepo.com/refinements-in-ruby

Traits are an improvement to mixins. IIRC Matz gave a talk (RubyConf 2010?) where he describes the proposed traits implementation. Here's one set of slides (not Matz's talk) which also shows some traits examples - http://www.slideshare.net/fabiokung/ruby-20-to-infinity-and-...


Half of these are not in ruby 2




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: