9 ms·
Ruby 2.0.0-preview1 is out
- whalesalad 14y agoI have a confession to make. I've been a Python (django+flask) guy for years, but I just recently jumped ship to Ruby and couldn't be happier. Within the last 60 days I've deployed 2 production websites, rebuilt my own personal blog, and am currently busting ass on my own project's API -- all of it in Rails. I still like Python, but I'm a HUGE fan of Ruby now. It's so much fun to write. I'm excited to be a part of such an active community as well. It seems like every week there is an exciting event, release, or new project being announced. Looking forward to building this locally, hopefully with these fast require patches applied: http://bugs.ruby-lang.org/issues/7158 http://bugs.ruby-lang.org/issues/7158 self.woohoo!
- aaronblohowiak 14y agowhat are the differences that make it more fun?
- whalesalad 14y agoThat's actually a really, really long comment. A blog post is definitely due about it, because I feel like a hacker again. Before I was in this fog of not enjoying what I was doing and always being up against some mountain/molehill problem.
- weaksauce 14y agoI am in the same boat as gp. rails has a lot of nice time savers, RVM is better than virtualenv, I like that in ruby you have more than one way to do things so you can write the way you feel most natural, ruby is more fun to program in for me(not a huge fan of the indentation now because I have had to reformat scripts to work correctly one too many times now). packaging in python is what pushed me over the edge though. It never felt like I could get anything installed nicely because the "best practice" for the packing managers were changing daily. rubygems is much nicer in that respect. I still like python but in the future I am going with ruby unless I have to use something else.
- tta 14y agorbenv (https://github.com/sstephenson/rbenv https://github.com/sstephenson/rbenv) is better than RVM.
- csarva 14y agoI used rbenv for a while but what killed it for me was the huge startup lag it adds to every invocation of ruby or any other bin installed via a gem. I was seeing delays of 4-5 sec which disappeared when I switched to RVM. The universe of tools and integration is also far better in RVM land (though this may have changed more recently).
- kingfishr 14y agoI had this problem right when I started using rbenv. Eventually with some help I realized that just starting bash was slightly slow, and that all the various bash scripts that rbenv runs were compounding this for a 2+ second startup. In my case, everything was fixed by moving the the things that only need to be run in login shells out of my ~/.bashrc (where they should have been in the first place). See the bug I filed against rbenv at the time: https://github.com/sstephenson/rbenv/issues/70 https://github.com/sstephenson/rbenv/issues/70 Since that time, I've been using rbenv exclusively (development and production) and it's been great.
- charliesome 14y agoquantify "better"
- crusso 14y agoTo paraphrase a coworker who also uses Ruby: Whenever I guess at how to do something new in Python, I'm usually wrong.
- stillmotion 14y agoAll those years you used to make fun of me.
- whalesalad 14y agoTrust me I feel like a tool for being such a fanboy.
- nickik 14y agoAnd now after just 60 days you are allready a fanboy of rails. You should overthink how you put your loyaltys.
- meskyanichi 14y agoTook me only 15 minutes to realize what I've been missing. ;)
- shinratdr 14y ago> You should overthink how you put your loyaltys. You should think harder about how you choose to phrase a sentence. "Overthink how you put your loyaltys"? C'mon.
- excid3 14y agoI had exactly the same experience. Long time Python developer, and then got into Rails and haven't looked back. Really love the readability of the language.
- bdesimone 14y agoI'm happy for you. Could you be more specific about how ruby (as a language) and rails (as a framework) are more fun to you coming from python and then django/flask respectively? Is it the language you like more? Or the rails community?
- themckman 14y agoAnecdotally, I've gone in the exact opposite direction. I had been doing Ruby/Rails for 3 years up until about December of last year and switched to Python. I can't say I dislike Ruby for any reason, however, I just have no desire to write software with it anymore.
- Toddward 14y agoHandy-dandy one-liner to install it with rbenv (provided you have ruby-build installed). curl https://raw.github.com/gist/3998200/a09c4eb21256ad17880f7d8dcc1455c5434a1815/2.0.0-preview1.sh https://raw.github.com/gist/3998200/a09c4eb21256ad17880f7d8d... | sh
- nilved 14y agoThat script could be a one-liner in and of itself.
- juzfoo 14y agoNot sure if RVM typically supported the preview releases. It would be nice if it did though.
- charliesome 14y agorvm install ruby-2.0.0-preview1
- xinuc 14y agoin my case, i need to do rvm install ruby-2.0.0-preview1 --verify-downloads 1
- deleted 14y ago[deleted]
- eta_carinae 14y agoIs it just me or has the world moved on from Ruby? I'm seeing more companies and projects moving away from it than adopting it. It feels like Ruby had a nice shot at becoming a mainstream language thanks to Rails but it just ended up blowing up like a bubble.
- excid3 14y agoPlenty of people still use it, but like anything "being cool" doesn't last for that long. Lots of people still use Perl, but it's not necessarily talked about as being "cool" for example.
- sanderjd 14y agoIt's just you! The Ruby community, especially the Rails portion, is undergoing a fantastic philosophical and tooling maturation, which is pushing its viability past its former fast-paced start-up confines and into a larger, but perhaps less sexy market. I'm not sure which companies and projects you're specifically referring to, but while we're throwing out anecdotes, it seems to me that companies "moving away" from Ruby are making pragmatic decisions in response to specific pain points, while keeping Ruby in place where it better solves other pain points. That's how it's supposed to work!
- Andys 14y agoThe latest weekend-long Rails Camp to be held here in Australia (in 2 weeks time) sold out within minutes, as it always has. As a counterpoint, many people who attend spend their time at camp not doing Rails stuff.
- veemjeem 14y agoI think it just became a mainstream language. Many shops use ruby now, but nobody really talks how they're "using" ruby because it isn't cool anymore. Kinda like in the 2000's when everyone was talking about how they were using Java and VCs would throw money in their face. It's rare to see a company these days to evangelize their use of Java. These days people prefer talking about how they're using node.js or Go.
- 14y ago
- salimmadjd 14y agoHas anyone done any performance testing on this yet? Just curious if the new bitmap GC is more efficient with memory and also if 2.0 is faster as it was promised.
- nivloc 14y agoBenchmarks don't mean much until it's released, if ever. But I was playing around with it, and it's hard not to get excited about performance! | mem | time | p1 | -24% | -3% | p2 | -8% | -12% | p3 | -31% | -12% | avg | -21% | -9% | (over 1.9.3) Those are a couple workers I fired up for an hour. p2 relies on a C library, which might account for the smaller drop in memory usage. CPU needs investigation. The numbers are kinda useless, but look good anyway.
- tbrock 14y agoNotable 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)
- pabloh 14y agoThere 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.
- draegtun 14y agoRuby 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-EXCLUSION-AND-ALIASING https://metacpan.org/module/Moose::Manual::Roles#METHOD-EXCL...
- pabloh 14y agoRefinements will be at the 2.0 release but I wouldn't call that feature "multiple inheritance".
- draegtun 14y agoNeither 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=1603321 | http://news.ycombinator.com/item?id=3455507 http://news.ycombinator.com/item?id=3455507). For further info on Ruby refinements see here: http://timelessrepo.com/refinements-in-ruby 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-beyond http://www.slideshare.net/fabiokung/ruby-20-to-infinity-and-...
- wiradikusuma 14y agohonest question. for someone who already know scala and groovy (moving from java), what is the selling point of ruby? esp in regards to (1) its syntax (2) its library and ecosystem and (3) its performance
- vorg 14y agoRuby's a top ten language -- neither Scala nor Groovy are anywhere near it -- so the ecosystem's much bigger. If we need JVM libraries, we can use JRuby without changing any source. Admittedly, Scala's performance is faster because it's statically compiled, while Groovy's syntax is more standard, i.e. closer to C/C++/Java/C#/Javascript/etc. So wrt (1), Groovy, (2), Ruby, and (3), Scala.
- rohitarondekar 14y ago(1) Syntax wise Ruby is a lot easier and more expressive than Scala. IMHO I feel that Ruby is an OO language with some functional sprinkles while Scala is a functional language with OO sprinkles. (2) Ruby has a great ecosystem if you are building web apps. It's also got a lot of testing libraries. :) But in seriousness the number of libraries in non web/tooling space is slowly increasing as faster Ruby implementations have become a focus point. Also JRuby allows you use the vast ecosystem of Java from within JRuby. (3) Performance wise I'm pretty sure Scala will outperform Ruby. I don't think JRuby will be able to compete either. Charles Nutter, JRuby Core developer wrote this blog post which explains why Ruby is hard to optimize ― http://blog.headius.com/2012/10/so-you-want-to-optimize-ruby.html http://blog.headius.com/2012/10/so-you-want-to-optimize-ruby... Of course take everything I've said with a bag of salt! :)
- wiradikusuma 14y agoadding answer to my own question: with Ruby(Motion) you can make native iOS apps, and it's 20% off http://news.ycombinator.com/item?id=4732827 http://news.ycombinator.com/item?id=4732827 (just saw it in frontpage)
- twelvechairs 14y agoThe detailed 2.0.0 features list is at https://bugs.ruby-lang.org/projects/ruby-trunk/roadmap#2.0.0 https://bugs.ruby-lang.org/projects/ruby-trunk/roadmap#2.0.0 for those interested. I'm surprised there's not more talk here about the interesting additional features, like Proc/Method#to_source
- matthuggins 14y agoI can't think of a situation when I'd need a method like Proc/Method#to_source, especially in everyday Ruby usage. That's probably why it's not being talked about as much as some of the other new features.
- lucisferre 14y agoI can't find any info on these method right now, but assuming they do the obvious, it's useful for all sorts of tooling and debugging situations. Situations you might not write the code for but almost certainly will use.
- senthilnayagam 14y agorvm get head rvm install ruby-2.0.0-preview1 installed it for me, but rubygems install failed
- nnq 14y ago"Named arguments" - what took you so long?! it always annoyed me that this is not always considered a standard language feature and added in from version 0.1 of any language, no need to hack around it by passing dicts/hashes around ...Python got this right long time ago ...it always amazes me that people never seem to care about this
- Xylakant 14y agoThe standard solution (using splat and passing a hash) was close enough to work. It's not named arguments, and it certainly has its pitfalls, but it was close enough for most things. So nobody obviously thought it was important enough to change before now. There's a lot of languages that don't have named arguments so it's probably not that much of a deal either.
- nnq 14y ago...but the perceived philosophy of Ruby is along the lines of "developer joy above anyth else" (above speed, above code readability etc.) and this is a 100% developer joy feature and it's been ignored time and time again (probably because people are too busy building cool stuff to have time to bitch about this but still...)
- Xylakant 14y agoIt is. And the feature hasn't really been ignored. The hash-syntax was amended so that passing arguments as hashes can be made to look more like named arguments [1]. It's still not named arguments, but about as good as you can make it while still remaining somewhat backwards compatible. So yes, it took a long while but no, the pain was not very great. I never really missed that. [1] Voice-of-Evening:~ fgilcher$ irb 1.9.3p125 :001 > def foo(args) 1.9.3p125 :002?> puts args.inspect 1.9.3p125 :003?> end => nil 1.9.3p125 :004 > foo bar: "baz", foo: "bar" {:bar=>"baz", :foo=>"bar"} => nil 1.9.3p125 :005 >
- holgersindbaek 14y agoAny plans on when 2.0.0 will be the standard? When will it be released to the world and when will it be adopted by people?
- cheald 14y agoIt's scheduled for a Feb 2013 release, and adoption among Rails folks will likely depend on how painful it is to upgrade to from 1.9.3.