3 ms·
Definitely interesting new features, and Ruby is putting up a good fight. But if it was really a ruby feature, and not just something tacked on to stay relevant
by tinco 6y ago
Definitely interesting new features, and Ruby is putting up a good fight. But if it was really a ruby feature, and not just something tacked on to stay relevant, that code example would've looked like this:
require 'async'
require 'net/http'
require 'uri'
["ruby", "rails", "async"].each.parallel do |topic|
Net::HTTP.get(URI "https://www.google.com/search?q=#{topic}")
end
I can't tell someone Ruby is beautiful, and then in the next sentence explain how you need to type Async twice just to get something to run asynchronously.
Same of course for Ruby types, we're just not yet on the point for a truly new way of writing Ruby for Ruby 3. Maybe we'll finally get something like this could be in Ruby 4, but I fear the spectre of backwards incompatibility is going to stand in the way of something that's both truly Ruby and truly in the 2020's.
- d3nj4l 6y agoAmen. As a massive ruby fan, I couldn’t put a finger on why I disliked ruby async, but you’ve got it exactly right.