Earlier quoted context omitted.
Latest talk about scheduler: https://www.youtube.com/watch?v=Y29SSOS4UOc Recent summary of scheduler, a little bit out of date (changes to interface): https://www.codeotaku.com/journal/2020-04/ruby-concurrency-f...
I will watch your presentation but if u could put my mind at ease: Is the scheduler a kind of event loop (like Node) implemented in Ruby? So if I wanted to use this thing everything I write would have to be callback based ?
Ruby 3.0 Preview 1
181–190 of 207 posts
Re: Ruby 3.0 Preview 1
#182Earlier quoted context omitted.
The programs aren't doing the same things. The Ruby one seems to buffer the matches into a huge string then print. Don't know how different it would be but better to compare apples.
IO.foreach without a block returns an enumerator.
IO.foreach('logs1.txt') {|x| puts x if /\b\w{15}\b/.match? x }
... runs in 1.3 secs, ie. same time as Python. Still, I exepcted Ruby 3x3 to beat standard Python.Re: Ruby 3.0 Preview 1
#183My thoughts: - 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 ca…
Now they just need to make it defless too.
Re: Ruby 3.0 Preview 1
#184Earlier quoted context omitted.
I will watch your presentation but if u could put my mind at ease: Is the scheduler a kind of event loop (like Node) implemented in Ruby? So if I wanted to use this thing everything I write would have to be callback based ?
Yes, it lets you implement event loop for Ruby. We use fibers to avoid callback hell and avoid rewriting existing code. This is covered in my talk here: https://www.youtube.com/watch?v=qKQcUDEo-ZI
Re: Ruby 3.0 Preview 1
#185Re: Ruby 3.0 Preview 1
#186I left Ruby because the performance and security weren't improving and the community was slowly dying. I delved into Go before that got flooded with newbs, then looked at Crystal and Pony, before settling on Rust and Haskell for most things.
How do you choose all this? I haven't been able to make a single decision for what language to use at work for the past 15 years. I thought wouldn't touch C#, ruby, delphi, kotlin and python but it all happened because someone was paying.
Hello PHP.
Re: Ruby 3.0 Preview 1
#187>Rightward assignment statement is added. >fib(10) => x 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…
The thing that most annoyed me about Rails (not Ruby) was that users.size users.length users.count are all valid, all useful, all have different meanings, are all present in plain Ruby but with different meanings, and contain absolutely no information about what they do. For reference, .length loads everything and gets the length of the collection, .count runs a SQL COUNT query, and .size uses length if the query has…
Re: Ruby 3.0 Preview 1
#188Not a Rubyist. Would Ractor allow one process to use up all CPUs while avoiding copying objects? Can I build shareable objects with immutable lists and maps right now?
Re: Ruby 3.0 Preview 1
#189Didn’t see it linked in the preview announcement, here’s the RBS syntax guide: https://github.com/ruby/rbs/blob/master/docs/syntax.md 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…
The other good thing about RBS being in separate files is it can be integrated into a library without breaking compatibility with older Ruby versions.