It's really great to see that with every big release, Ruby is making the language even more pleasant to use in addition to the regular performance improvements. Ruby just keeps getting better and better.
Ruby 2.3.0 Released
41–50 of 73 posts
Re: Ruby 2.3.0 Released
#42with the existence of Perl6, Clojure, F#, Rust, Go, and few others ... For someone who doesn’t know Ruby, why learn it today?
For me: because nothing else approaches it in terms of linguistic flexibility. I learned Ruby about two years ago, after learning...a dozen-ish languages? Something like that. I don't write web applications in it, because Rails grinds my gears for a whole host of reasons, but for my money it is the can-opener language. If I have a problem, I feel like I can generally explore it faster in Ruby (holla, Pry) and build a…
Re: Ruby 2.3.0 Released
#43Earlier quoted context omitted.
For me: because nothing else approaches it in terms of linguistic flexibility. I learned Ruby about two years ago, after learning...a dozen-ish languages? Something like that. I don't write web applications in it, because Rails grinds my gears for a whole host of reasons, but for my money it is the can-opener language. If I have a problem, I feel like I can generally explore it faster in Ruby (holla, Pry) and build a…
What about Elixir?
Re: Ruby 2.3.0 Released
#44 /ruby-2.3.0/bin/ruby
?Re: Ruby 2.3.0 Released
#45Looks like some nice additions. I try to limit the use of .try in rails, however when working with legacy codebases it is much nicer then: if @user && @user.address && @user.address.city city = @user.address.city end Even though I write less Ruby then I once did, I still credit it as the language which shaped my career the most. I have worked so many great jobs because of Ruby.
params.dig(:user, :address, :city)
Re: Ruby 2.3.0 Released
#46I couldn't find any actual examples on how to use the new frozen string literals. Lots of discussion in the link provided, but that's it.
# frozen_string_literal: true
str = 'foo'
str
This will now produce an error: # main.rb:3:in `': can't modify frozen String (RuntimeError)
It's equivalent to Ruby 2.1's String#freeze:[2] str = 'foo'.freeze
str ': can't modify frozen String (RuntimeError)
Except that it will affect all strings created after the pragma mark.You can also trigger this behavior globally with the --enable=frozen-string-literal option.
[1]: https://github.com/ruby/ruby/blob/v2_3_0/NEWS#L17-L26
[2]: http://ruby-doc.org/core-2.2.3/Object.html#method-i-freeze
Re: Ruby 2.3.0 Released
#47Ah, YARV finally adds bytecode compilation and loading as an "experimental" feature. It'll be interesting to see what people do with it.
I could see it making deployment faster or nicer. Imagine being able to compile all the byte code for a Rails app locally and just shoving that up instead of waiting on bundling and all that. Also I think this would make possible hot code upgrades which are cool but probably more work than their worth. Unless you can build smart hooks into background job and web server libraries that only change the byte code in betw…
Re: Ruby 2.3.0 Released
#48This is actually a really great release. `&.` removes the really annoying (and slow) `try`. And I think the string literals freezing is going to solve a lot of problems with memory allocations. Check out this PR for Rails that covered a lot of similar performance problems created by too many string allocations. https://github.com/rails/rails/pull/21057/files I wish Rails 5 could go all in on Ruby 2.3.0 and frozen str…
How prevalent is `try` in rails/activesupport? My benchmarks show that the lonely operator is ~2x faster than `try`. I'd expect someone to create a gem that monkey patches `try` for those running 2.3.0.
Re: Ruby 2.3.0 Released
#49Nice to see "Did You Mean" suggestions flourishing across various tools now, e.g. Git too. Error messages can be a whole lot more than indecipherable jargon, even for command-line warriors. I'm also looking forward to never writing "if foo && foo.bar" again! Congrats and happy holidays Ruby team :).
Re: Ruby 2.3.0 Released
#50Earlier quoted context omitted.
For me: because nothing else approaches it in terms of linguistic flexibility. I learned Ruby about two years ago, after learning...a dozen-ish languages? Something like that. I don't write web applications in it, because Rails grinds my gears for a whole host of reasons, but for my money it is the can-opener language. If I have a problem, I feel like I can generally explore it faster in Ruby (holla, Pry) and build a…
What about Elixir?