@tenderlove@mastodon.social
@tenderlove@mastodon.social avatar

tenderlove

@tenderlove@mastodon.social

Rails Core / Ruby Core.
PGP: 4CE9 1B75 A798 28E8 6B1A A8BB 9531 70BC B4FF AFC6
Switch: SW-6099-0664-6989
He/Him
tfr

This profile is from a federated server and may be incomplete. Browse more on the original instance.

tenderlove, to random
@tenderlove@mastodon.social avatar

I've been tooting about optimizing delegate calls in Ruby (... calls), which I think are relatively rare. But the main motivation is that I want to implement Class#new in Ruby using delegation. I made a WIP PR and you can see the implementation of Class#new here: https://github.com/ruby/ruby/pull/9289/files#diff-919ef5932e2ffb97a00a90eb06036b733c6d26cf69cc13014a3ac174bd351fde

tenderlove,
@tenderlove@mastodon.social avatar

this would make delegate calls incredibly common, so it's important that they'd be fast. Anyway, if you combine the delegate optimization along with implementing Class#new in Ruby it actually reduces object allocations because passing kwargs across a Ruby to C boundary requires allocating a hash. Here's a screenshot of both patches combined vs Ruby's master branch

tenderlove,
@tenderlove@mastodon.social avatar

@byroot ya, I was trying to downplay it a little 😆

Anyway the patches are green in Shopify core CI, but we need to implement the YJIT side of things (hopefully after I get back from TropicalRB if not sooner)

tenderlove,
@tenderlove@mastodon.social avatar

@byroot would it help that? You're already doing Ruby -> Ruby. Positional args don't need to allocate when calling a c function

leah, to random
@leah@blahaj.social avatar

Who called it currency exchange and not buck converter?

tenderlove,
@tenderlove@mastodon.social avatar

@leah lol watt

tenderlove, to random
@tenderlove@mastodon.social avatar

I'm really excited to speak at Tropical.rb next week so I thought I would try to learn some Portuguese only to find out that I don't know even any basic Portuguese. I guess the good news is that I'm not that great at English either 😆

tenderlove, to random
@tenderlove@mastodon.social avatar

You don't need special glasses to watch a total eclipse of the heart

tenderlove, to random Japanese
@tenderlove@mastodon.social avatar

Really great PR. Comments are worth the read!
https://ruby.social/@st0012/112157401876578122

ted, to random
@ted@an.errant.cloud avatar

@tenderlove @tenderlove hey man, thanks for https://tenderlovemaking.com/2024/02/16/using-serial-ports-with-ruby.html

Been tinkering with wifi stumbling and a flipper zero, and the protocol for communicating w/ the Flipper is UART over USB.

I def can control my flipper zero & the wifi module from the CLI. I'm trying to figure out if can also stream the results out over the UART/USB interface :)

tenderlove,
@tenderlove@mastodon.social avatar

@ted @tenderlove Nice! You're welcome, and I'm glad you're using it! I'm trying to make the gem more popular because I think people these days are still trying to use the serialport gem, but it's basically abandoned and too hard to fix. If you run in to any problems, lmk, and if you have any examples for the readme I'd appreciate it!

tenderlove,
@tenderlove@mastodon.social avatar

@ted @tenderlove awesome, thank you! Mind if I add it to the readme?

tenderlove,
@tenderlove@mastodon.social avatar

@ted awesome thank you!

tenderlove,
@tenderlove@mastodon.social avatar

@ted np. I can do it. Just busy today (I'll get to it tomorrow 🙇🏻‍♂️)

tenderlove, to random
@tenderlove@mastodon.social avatar

日本に住むなら島根県に住みたい!😄

tenderlove, to random
@tenderlove@mastodon.social avatar

Worked more on optimizing delegates with @jhawthorn today. There are more edge cases that I thought there would be (of course), but I'm testing it in work CI rn. Anyway, I really hope we can land this in Ruby 3.4 (I'm confident we can)

tenderlove,
@tenderlove@mastodon.social avatar

@junkman @jhawthorn thanks! Hopefully it will be

tenderlove,
@tenderlove@mastodon.social avatar

@josephholsten @jhawthorn Rails uses SimpleDelegator (I found while working on these patches 😅). Delegate methods seem to be pretty popular internally to Rails, though most of them are using Rails' own delegate

tenderlove, to random
@tenderlove@mastodon.social avatar

Happened on a hockey game today. Only caught the last 15min or so, but it was great!!

tenderlove, to random
@tenderlove@mastodon.social avatar

Went to Kerry Park this morning to watch the sun rise

tenderlove, to random
@tenderlove@mastodon.social avatar

Going live in about 5 min. Join if you have time! https://www.youtube.com/watch?v=ELa9vgPA1B4

tenderlove,
@tenderlove@mastodon.social avatar

@olleolleolle thank you!

tenderlove, to random
@tenderlove@mastodon.social avatar

Worked on an optimization to delegate methods with @jhawthorn today and I'm pretty excited about the progress. Need to fix more tests before I can land this patch, but I'm very happy about where it is and hopeful it will unlock other optimizations

tenderlove, to random
@tenderlove@mastodon.social avatar

Doing a live stream this week! I'll have @jhawthorn on as a guest, and we're going to hack on Vernier. We'll do it this Friday at 10:00 PDT (17:00 UTC), please join if you have time! https://youtube.com/live/ELa9vgPA1B4

tenderlove, to random
@tenderlove@mastodon.social avatar

The Smithsonian has tons of Ruby Gems!

tenderlove, to random
@tenderlove@mastodon.social avatar

Trying to look romantic

jenn, to random
@jenn@pixel.kitchen avatar

we need to normalize recognizing that Coke Zero and Diet Coke are two very different drinks, not alternatives or dupes of each other. it’s like apple or orange juice

tenderlove,
@tenderlove@mastodon.social avatar

@jenn I'm looking forward to drinking Diet Coke Zero

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • kavyap
  • DreamBathrooms
  • normalnudes
  • magazineikmin
  • InstantRegret
  • GTA5RPClips
  • thenastyranch
  • Youngstown
  • rosin
  • slotface
  • osvaldo12
  • ngwrru68w68
  • ethstaker
  • JUstTest
  • everett
  • Durango
  • Leos
  • cubers
  • mdbf
  • khanakhh
  • tester
  • modclub
  • cisconetworking
  • anitta
  • tacticalgear
  • provamag3
  • lostlight
  • All magazines