News for hackers. Stuff that matters.
Re:Ruby 3.0 Preview 1 by sdwolfz on Friday September 25, 2020 @05:00PM (#24594045)
My 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 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!

Re:Ruby 3.0 Preview 1 by djur on Friday September 25, 2020 @05:12PM (#24594162)
"Default gems" means that they're packaged as a gem but always implicitly available, as if you had included them in your Gemfile.

"Bundled gems" means the same thing, but you do have to include them in your Gemfile.

https://github.com/janlelis/stdgems#about-the-gemified-stand...

Re:Ruby 3.0 Preview 1 by sdwolfz on Friday September 25, 2020 @05:18PM (#24594211)
Thank you for clarifying this for me. In that case, the rexml gem situation sounds like a demotion...
Re:Ruby 3.0 Preview 1 by ioquatix on Friday September 25, 2020 @06:24PM (#24594733)
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...

Re:Ruby 3.0 Preview 1 by joelbluminator on Saturday September 26, 2020 @05:26AM (#24597496)
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 ?
Re:Ruby 3.0 Preview 1 by ioquatix on Saturday September 26, 2020 @06:30AM (#24597727)
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 by joelbluminator on Saturday September 26, 2020 @07:03AM (#24597876)
Hope it's alright to ask you a personal question: How did you get to the point you can work with Ruby internals so well? Did you come from a C background or had some backgrounds with VM's / programming language design?
Re:Ruby 3.0 Preview 1 by tomstuart on Friday September 25, 2020 @06:52PM (#24594897)
You may be interested in precompiled native Nokogiri: https://github.com/sparklemotion/nokogiri/issues/2075
Re:Ruby 3.0 Preview 1 by JohnBooty on Friday September 25, 2020 @05:35PM (#24594353)
My thoughts:

- A Ruby "Preview 1" release? Oh crap, I have to start Christmas shopping soon.

Re:Ruby 3.0 Preview 1 by onekorg on Friday September 25, 2020 @07:11PM (#24595009)
I just realized why I have a lot of christmas memories of me sitting around with family while reading hacker news comments in a thread about a ruby release.

Never noticed it's always released on December 25th.

Re:Ruby 3.0 Preview 1 by burlesona on Friday September 25, 2020 @07:31PM (#24595099)
Yeah playing with new Ruby is one of my favorite parts of Christmas :)
Re:Ruby 3.0 Preview 1 by czbond on Friday September 25, 2020 @06:04PM (#24594580)
This is funny. Need more inside engineering jokes...
Re:Ruby 3.0 Preview 1 by transfire on Saturday September 26, 2020 @06:59AM (#24597849)
> Endless method: this one is cute, I love it!

Now they just need to make it defless too.

Re:Ruby 3.0 Preview 1 by UncleOxidant on Friday September 25, 2020 @05:32PM (#24594321)
> - Endless method: this one is cute, I love it!

It's a weird name for it. It should probably be called something like 'equational method definitions'

Re:Ruby 3.0 Preview 1 by coldtea on Friday September 25, 2020 @08:47PM (#24595491)
>It should probably be called something like 'equational method definitions'

Yeah, that's not weird

Re:Ruby 3.0 Preview 1 by baggy_trough on Friday September 25, 2020 @06:19PM (#24594704)
It's sort of a pun, because the method doesn't need an "end".
Re:Ruby 3.0 Preview 1 by faheel on Friday September 25, 2020 @11:52PM (#24596273)
You're right. Maybe hyphenation would help here: "End-less methods"
Re:Ruby 3.0 Preview 1 by inopinatus on Saturday September 26, 2020 @01:03AM (#24596571)
It's a bit of whimsy from the originator of that feature:

https://bugs.ruby-lang.org/issues/16746