havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.1, 3.0.3, 2.7.5: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
r3m has quit [Quit: WeeChat 3.5-dev]
r3m has joined #ruby
robotmay has quit [Ping timeout: 250 seconds]
factor has quit [Read error: Connection reset by peer]
eddof13 has joined #ruby
ur5us has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
howdoi has quit [Quit: Connection closed for inactivity]
donofrio has joined #ruby
jimeh has quit [Remote host closed the connection]
jimeh has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
jimeh has quit [Remote host closed the connection]
markmarkmark has quit [Quit: WeeChat 2.9]
jimeh has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
gproto23 has joined #ruby
Guest1667 has joined #ruby
Guest1667 has quit [Client Quit]
roadie has joined #ruby
ua_ has quit [Excess Flood]
ua_ has joined #ruby
szkl has quit [Quit: Connection closed for inactivity]
Rounin has quit [Ping timeout: 260 seconds]
roadie has quit [Ping timeout: 245 seconds]
eddof13 has joined #ruby
roadie has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oxfuxxx has joined #ruby
oxfuxxx has quit [Ping timeout: 250 seconds]
oxfuxxx has joined #ruby
roadie has joined #ruby
oxfuxxx has quit [Ping timeout: 256 seconds]
oxfuxxx has joined #ruby
oxfuxxx has quit [Ping timeout: 252 seconds]
roadie has quit [Ping timeout: 256 seconds]
ur5us has quit [Ping timeout: 240 seconds]
libsys has quit [Ping timeout: 256 seconds]
donofrio has quit [Remote host closed the connection]
roadie has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
gcd has quit [Ping timeout: 256 seconds]
gcd has joined #ruby
finsternis has quit [Ping timeout: 256 seconds]
finsternis has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
cxl_ has quit [Quit: bye]
comet23_ has joined #ruby
<comet23_> is ruby 3 worth upgrading to
roadie has joined #ruby
Guest7375 has joined #ruby
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
cxl has joined #ruby
teclator has joined #ruby
<jhass[m]> Sure, why not. Only few breaking changes (nothing 2.7 wouldn't spam you about already), little faster, couple new features.
roadie has joined #ruby
txdv has quit [Ping timeout: 240 seconds]
Rounin has joined #ruby
infinityfye has joined #ruby
ur5us has joined #ruby
comet23_ has quit [Quit: Connection closed for inactivity]
taupiqueur has joined #ruby
roadie has quit [Ping timeout: 268 seconds]
Furai has quit [Quit: WeeChat 3.4.1]
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
Furai has joined #ruby
perrierjouet has quit [Ping timeout: 240 seconds]
infinity_fye has joined #ruby
infinity_fye has quit [Client Quit]
perrierjouet has joined #ruby
infinity_fye has joined #ruby
infinityfye has quit [Ping timeout: 240 seconds]
infinity_fye is now known as infinityfye
roadie has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
ur5us has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
Tempesta has quit [Quit: See ya!]
TomyWork has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
Tempesta has joined #ruby
roadie has joined #ruby
ua_ has quit [Ping timeout: 245 seconds]
<nakilon> I saw no speed improvement since 2.4 (
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
<leah2> i have to admit i like the pattern matching
<leah2> but i dont get why pinning is needed
<nakilon> is this any good? https://vega.dokkuapp.com/
ua_ has joined #ruby
<jhass[m]> leah2: it's for when you want to match against the value of variable rather than capture into it. https://carc.in/#/r/cwdv makes some sense?
<leah2> jhass[m]: but bound variables already match with equality no?
<jhass[m]> maybe I don't get what you mean with a bound variable but I believe my example shows otherwise?
<leah2> hm, i thoughy i had a bug yesterday due to case e; in [:foo, e] not rebinding e
<leah2> wierd
<havenwood> nakilon: I've seen substantial speed improvements since Ruby 3. Fiber scheduler is huge, but a bunch of tiny improvements can add up too if it aligns with what you're doing.
<havenwood> nakilon: In some cases, especially without a JIT, not too much difference from Ruby 2.4.
gproto23 has quit [Remote host closed the connection]
gproto23 has joined #ruby
Sheilong has joined #ruby
infinityfye has quit [Ping timeout: 250 seconds]
infinityfye has joined #ruby
perrierjouet has quit [Quit: WeeChat 3.4.1]
infinityfye has quit [Quit: Leaving]
roadie has joined #ruby
oxfuxxx has joined #ruby
oxfuxxx has quit [Ping timeout: 256 seconds]
Thanzex has quit [Read error: Connection reset by peer]
Thanzex4 has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
<adam12> morning
roadie has joined #ruby
roadie has quit [Remote host closed the connection]
roadie has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
<adam12> Does anybody recall if an anonymous Struct affects constant invalidation? Struct.new(:foobar).new("baz")
<adam12> I'm inclined to think it will, once the GC runs...
donofrio has joined #ruby
<adam12> Hmm. It doesn't affect gobal_constant_state counter in RubyVM.stat. Maybe I'm wrong.
FetidToot has quit [Quit: The Lounge - https://thelounge.chat]
FetidToot has joined #ruby
nmollerup has quit [Remote host closed the connection]
<mooff> adam12: i think the Struct.new('ConstantName', :foobar) form will, but not the Struct.new(:foobar) form
<adam12> mooff: I'm inclined to agree.
roadie has joined #ruby
<mooff> the former gets to new_struct in struct.c, the latter gets to anonymous_struct
<adam12> I did look at that, but I was more curious about the anonymous Class.
<adam12> But I think the constant invalidation only happens with the `class` keyword...
roadie has quit [Ping timeout: 240 seconds]
<ox1eef> what is constant invalidation?
<adam12> ox1eef: I don't recall the specifics (I think its covered in the Ruby Under a Microscope book), but because of the way constant lookup works in Ruby, it can be somewhat expensive. So there's an internal cache that stores the values of constant lookups. When a constant is defined, the cache is invalidated.
<ox1eef> ah i see, sounds similar to the method cache
<adam12> I'd presume Class.new to not invalidate cache because it's not creating a constant, BUT I couldn't remember about Struct.new, because there are incantations of Struct.new that does create a constant, under the Struct namespace.
<adam12> Yeah. Very similar to method cache.
<ox1eef> thanks
<adam12> Struct.new(:foobar) could technically do Struct.const_set(:SomeAnonymousClassName, my_struct). Which is what I was trying to remember. But I think it's safe.
<adam12> After all this, I'm probably going to refactor it out to it's own constant anyways, but I never usually Struct.new.new in a hotpath. And I struggled to remember if it was cache invalidation as to why I never did.
<ox1eef> i would think unless you assign a constant, there is no new constant being introduced. Struct.new(:foo).name => nil
_ht has joined #ruby
roadie has joined #ruby
Guest7375 has quit [Ping timeout: 256 seconds]
roadie has quit [Ping timeout: 252 seconds]
libsys has joined #ruby
<ox1eef> that got me thinking to what happens when you have two constant references to one struct, looks like the first assignment wins.
oxfuxxx has joined #ruby
TCZ has joined #ruby
John_Ivan__ has quit [Read error: Connection reset by peer]
hololeap has quit [Excess Flood]
John_Ivan has joined #ruby
hololeap has joined #ruby
tungki has joined #ruby
<nakilon> havenwood, idk, years already have passed since 2.3 and the only slight improvement was in 2.4 around Bigint; even with jit; the only thing that improved my programs speed were alternative ruby implementations
<nakilon> *implementation; that is truffleruby
roadie has joined #ruby
roadie has quit [Client Quit]
<nakilon> this was probably the last one I tried to speed up by switching the ruby versions and implementations https://dpaste.org/eDWT/slim
nullheroes has quit [Quit: WeeChat 2.8]
<nakilon> btw, I always forget, when someone here asks how to compile the ruby inro executable, he might want to try this https://github.com/natalie-lang/natalie
<nakilon> not full stdlib is covered and maybe it can't compile smoe gem dependencies but for simple scripts it works
<nakilon> for now their executable is slower than ruby but they said they are working on it
<nakilon> looks like they've increased the ruby/spec coverage from 40% to 90% in half a year https://natalie-lang.org/
libsys has quit [Ping timeout: 250 seconds]
libsys has joined #ruby
TCZ has quit [Quit: Leaving]
tungki has quit [Ping timeout: 256 seconds]
_whitelogger has joined #ruby
Guest7375 has joined #ruby
<havenwood> nakilon: have you tried with 3.1 and --yjit, I'm curious?
oxfuxxx has quit [Ping timeout: 250 seconds]
oxfuxxx has joined #ruby
oxfuxxx has quit [Ping timeout: 256 seconds]
<mooff> nakilon: or she :-)
tungki has joined #ruby
<mooff> help, i'm addicted to Object#tap and Object#then
gproto23 has quit [Read error: Connection reset by peer]
taupiqueur has quit [Ping timeout: 240 seconds]
taupiqueur has joined #ruby
<adam12> Heh
tungki has quit [Ping timeout: 256 seconds]
unyu has quit [Ping timeout: 240 seconds]
taupiqueur has quit [Quit: taupiqueur]
mdemo has joined #ruby
unyu has joined #ruby
trillp has joined #ruby
justAstache has quit [Remote host closed the connection]
justAstache has joined #ruby
<ox1eef> there are worse addictions out there
fef has joined #ruby
gr33n7007h has quit [Quit: WeeChat 3.4]
mixfix41 has quit [Ping timeout: 256 seconds]
ralu has quit [Ping timeout: 256 seconds]
ralu has joined #ruby
nachnacht has joined #ruby
nachnacht has quit [Client Quit]
oxfuxxx has joined #ruby
ur5us has joined #ruby
fef has quit [Ping timeout: 240 seconds]
TomyWork has quit [Quit: Leaving]
ralu has quit [Ping timeout: 240 seconds]
<mooff> following the SSL thing the other day, i've come up with this: https://github.com/awfulcooking/iirc/blob/main/lib/iirc.rb#L69
<mooff> and added some examples/, after giving in to letting the library dial for us :)
ralu has joined #ruby
oxfuxxx has quit [Ping timeout: 250 seconds]
oxfuxxx has joined #ruby
m_antis has quit [Ping timeout: 256 seconds]
_ht has quit [Remote host closed the connection]
trillp has quit [Quit: WeeChat 3.3]
roadie has joined #ruby
TCZ has joined #ruby
ivanf has joined #ruby
ivanf has quit [Changing host]
ivanf has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
oxfuxxx has quit [Ping timeout: 250 seconds]
Sheilong has quit []
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
oxfuxxx has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 268 seconds]
TCZ has quit [Quit: Leaving]
roadie has joined #ruby
<wand> is it bad form to have an object attribute be a complex data structure such as a tree or nested hash
roadie has quit [Ping timeout: 268 seconds]
<wand> i've been using ruby with a functional paradigm for a while. finally learning about oo design patterns etc
<mooff> i think that's usually quite okay, wand
hololeap has quit [Remote host closed the connection]
hololeap has joined #ruby
<weaksauce> as opposedto what wand
<wand> mooff: thanks. just wanted a sanity check or alternate best practice, etc.
nmollerup has joined #ruby
roadie has joined #ruby
<wand> weaksauce: i don't know, i though maybe breaking out the tree into separate attributes might be better. I'd rather group them, sounds like that's normal
<weaksauce> like anything it depends
<wand> stoked about oo. reading the c2 wiki. i bough booch's book but maybe would have been better to get gang of four
<wand> right weaksauce
<wand> can anyone recommend a simple codebase using oo design principles i could go read to grok how it's properly done?
roadie has quit [Ping timeout: 240 seconds]
oxfuxxx has quit [Ping timeout: 252 seconds]
oxfuxxx has joined #ruby
<mooff> which aspects in particular? what sort of things do you want to program?
oxfuxxx has quit [Ping timeout: 260 seconds]
oxfuxxx has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
peer has quit [Quit: Ping timeout (120 seconds)]
peer has joined #ruby
Guest7375 has quit [Quit: Konversation terminated!]
vit has joined #ruby
vit is now known as freeworld
oxfuxxx has quit [Ping timeout: 256 seconds]
freeworld has quit [Quit: Konversation terminated!]
freeworld has joined #ruby
freeworld has quit [Client Quit]
freeworld has joined #ruby
freeworld has quit [Client Quit]
freeworld has joined #ruby