Ruby 2.0.0-preview1 is out
blade.nagaokaut.ac.jp
blade.nagaokaut.ac.jp
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
self.woohoo!
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
Since that time, I've been using rbenv exclusively (development and production) and it's been great.
# Source a .rvmrc file in a directory after changing to it, if it exists. To
# disable this feature, set rvm_project_rvmrc=0 in /etc/rvmrc or $HOME/.rvmrc
IMHO rvm is completely overkill and suffers from overengineering.[0]: https://github.com/wayneeseguin/rvm/blob/master/scripts/cd
Define slow:
$ time /home/lloeki/.rbenv/versions/1.9.3-p286/bin/ruby -e 'exit'
real 0m0.012s
user 0m0.007s
sys 0m0.003s
$ rbenv global
1.9.3-p286
$ time /home/lloeki/.rbenv/shims/ruby -e 'exit'
real 0m0.055s
user 0m0.027s
sys 0m0.007s
Hardly something to cry foul for. Your first significant require will blow that time by an order of magnitude.And hardly surprising either since rbenv the alias calls rbenv the command, which sets a few env vars then calls rbenv-$1 (probably $1==exec), which calls rbenv-hooks $1 (probably a noop by default) then $1 + args. rbenv is seriously thin.
> huge startup lag it adds to every invocation of ruby or any other bin installed via a gem
Sounds more like bundler (maybe automatically started by ohmyzsh when just typing 'ruby' where you have a Gemfile):
$ time bundle exec ruby -e 'exit'
real 0m0.570s
user 0m0.480s
sys 0m0.057s
or as mentioned, someone put too much stuff in his bashrc or something.You should think harder about how you choose to phrase a sentence. "Overthink how you put your loyaltys"? C'mon.
I'm surprised there's not more talk here about the interesting additional features, like Proc/Method#to_source
| 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.
As a counterpoint, many people who attend spend their time at camp not doing Rails stuff.
These days people prefer talking about how they're using node.js or Go.
I have worked with Ruby professionally for 5 years. From my perspective there is more opportunity now then years back, more high quality code being written, more problems can be solved in less time, etc
This is still a very exciting place to be. I have found being good at Ruby has provided the highest ROI of my career.
In DFW, traditionally a dense forest of Enterprisey .NET and J2EE projects, I've seen a LOT of new Rails gigs pop up. A number of startups (growing in this area), but also big companies like Raytheon. I had a long conversation with an Adobe recruiter last year about their Rails initiative, and unless someone can point me towards different information, is it not the case that most web startups default question now is -- "is there a good reason NOT to do this in Rails?"
Rails and Ruby right now feel like Java circa the early 00s or thereabouts, where JVM performance concerns/FUD had clearly been dealt with and pretty much everyone was on board.
My hunch is we may look back on the last couple of years as being a similar tipping point for Ruby/Rails.
Let's not forget the advancement of JRuby (JVM Ruby), Rubinius (LLVM Ruby), MacRuby (For Native OSX Desktop Apps), RubyMotion (For Native iOS Apps), mRuby (For Embedded Apps).
Not to mention the truck load of conferences every year, the new and existing, accessible and easy-to-use open source projects that are being released and updated frequently.
"Is it just me or has the world moved on from Ruby?".sub("from", "to")
We're doing our best. :)
There's a lot of languages that don't have named arguments so it's probably not that much of a deal either.
[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 >
curl https://raw.github.com/gist/3998200/a09c4eb21256ad17880f7d8d... | sh
rvm install ruby-2.0.0-preview1 rvm install ruby-2.0.0-preview1 --verify-downloads 1installed it for me, but rubygems install failed
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.
(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...
Of course take everything I've said with a bag of salt! :)
- 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)Also, there won't be MVM (Sandboxed VMs) on this release.
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 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-...