by polysaturate on 9/25/20, 7:08 PM with 203 comments
by sdwolfz on 9/25/20, 9:00 PM
- RBS: meh... might get more useful in the future (in 2-5 years maybe).
- Ractor: Wohooo! I'm writing a DAG library where I was thinking of implementing something like this, good to know I can use it and get real parallelism on top.
- Scheduler: :shrug: don't know about this one, might be relevant with future concurrent ruby code, any ideas?
- Rightward assignment: it's a bit awkward but I see the use case, just wish we had the pipe operator too like in Elixir.
- Endless method: this one is cute, I love it!
- Find pattern: oh boy, code reviews are going to be interesting now!
- Hash#except: yes, definitely a welcome one.
- Memory view: if this helps with numpy style gems it will be great!
- `send(:"do_#{ meth }", ...)`: don't do meth kids! (it's a joke!)... seems like a reasonable feature.
- `order of backtrace had been reversed`: good! it was confusing...
- Promote default gems to bundled gems (rexml): I like this one, if only nokogiri was a stdlib gem or part of core, imagine how much time would be saved instead of having to compile it every time in a `bundle install`.
- `Promote stdlib to default gems`: what does this mean? Do I now have to add `gem "securerandom"` to Gemfiles instead of having it by default and just needing to require it?
- Mjit improvements: can't wait to try it!
Overall, I'm delighted!
by reader_mode on 9/25/20, 8:45 PM
This is exactly the kind of stuff I hated when I had to work with ruby in my last gig and why I will never accept a job using it again - soo many pointless and inconsistent ways to do the same thing ... they have method aliases for collection operations like map/filter in standard library ! .NET went with non-standard SQL-like names (select/where) and I'm not a fan but at least they made their choice and stuck with it. And it's inconsistent all over the place - like '!' postfix means "operation mutates the object" in std lib BUT in rails it means the operation will raise an exception and not return an error code.
Now they add a pointless operator that means completely different thing in other languages to throw off even more people.
It's just a hell of a language to maintain someone else's code in.
by eddietejeda on 9/25/20, 9:03 PM
Personally, I am very excited for this release.
* Matz's goal to get Ruby 3 to be 3x faster than Ruby 2.
--
@sosodev Thanks for the updated info!
by rco8786 on 9/25/20, 11:40 PM
But the right hand assignment operator. What on earth. Nobody asked for that and nobody wants it. Why.
by phaedryx on 9/26/20, 5:45 AM
I'm not a fan of rightward assignment because I don't see much value and now the => operator has even more meanings.
I'm not a fan of endless methods because how lazy do you have to be to not want to type 'end'? My editor does it for me automatically. Now there is even more parsing.
by d2161 on 9/25/20, 8:41 PM
by shadykiller on 9/25/20, 8:35 PM
by Justsignedup on 9/25/20, 7:58 PM
Okay time to upgrade to latest rails and wait for the multithreaded rails release. :P
by jasonhansel on 9/25/20, 9:18 PM
by gorgoiler on 9/26/20, 4:59 AM
If RBS was for end users, adding types inline with the source code would make more sense compared to the RBS approach: keeping the source file and typedef file in sync.
That might actually be a pretty smart move. At first it seemed inconvenient to have to maintain a separate file for the type information, but maybe this focus on type-checking being made easy for the 90% of us who hack scripts is a much smarter one.
by crb002 on 9/26/20, 4:11 PM
by Jarred on 9/25/20, 8:35 PM
JavaScript has a similar pattern with Workers, and it makes concurrency for hot code impractical. Serializing/deserializing objects is a lot slower than just not doing that. In JavaScript’s case, you can also use SharedArrayBuffer, but Safari hasn’t re-enabled it.
by wbharding on 9/26/20, 12:54 AM
See also: list of the biggest tickets tackled in 3.0: https://www.gitclear.com/open_repos/ruby/ruby/release/pendin...
by riffraff on 9/25/20, 7:43 PM
by desireco42 on 9/25/20, 7:52 PM
There are some seriously good stuff there.
by juliend2 on 9/25/20, 8:02 PM
by sickcodebruh on 9/25/20, 10:55 PM
Glanced at it from my phone but it looks good! I’m looking forward to seeing it in RubyMine. Still sad that we can’t write these in .rb files but I wonder if the plan is to go the other way, eventually permit typed code in .rbs?
Does anyone know what the story will be with third-party definitions? Are we headed towards a DefinitelyTyped style repository for Ruby?
by aryik on 9/26/20, 12:46 AM
by bilekas on 9/26/20, 2:15 AM
by jakearmitage on 9/25/20, 10:38 PM
by aitchnyu on 9/26/20, 11:53 AM
by phplovesong on 9/26/20, 8:28 AM
by pw on 9/26/20, 12:07 AM
by nanna on 9/26/20, 4:31 PM
by justinzollars on 9/26/20, 3:58 AM
by sarfraaz on 9/26/20, 8:58 AM
by monadic2 on 9/25/20, 11:44 PM
by zelly on 9/25/20, 9:00 PM
by hexbinencoded on 9/26/20, 4:37 AM
by stevebmark on 9/25/20, 8:31 PM
by cutler on 9/26/20, 1:08 AM
Ruby
puts IO.foreach('logs1.txt').grep /\b\w{15}\b/
Python
from re import compile
with open('logs1.txt', 'r') as fh:
regex = compile(r'\b\w{15}\b')
for line in fh:
if regex.search(line): print(line, end='')
On my MacBook Pro (2013) running Catalina Ruby averaged 1.49 secs and Python 1.27 secs. The file `logs1.txt` is a 20Mb Apache log file. Pre-compilation with: reg = Regex.compile /\b\w{15}\b/
puts IO.foreach('logs1.txt').grep reg
... slowed Ruby down to 1.57 secs.Using --jit didn't change Ruby's overall time but considering it adds 700ms to Ruby's startup time execution time was faster.