havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.1, 2.6.6, 2.5.8: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
greypack has quit [Ping timeout: 240 seconds]
greypack has joined #ruby
buckworst has quit [Quit: WeeChat 2.8]
buckworst has joined #ruby
sergioro has quit [Quit: leaving]
Technodrome has quit [Remote host closed the connection]
sergioro has joined #ruby
asuper has quit [Quit: WeeChat 2.8]
sergioro has quit [Client Quit]
TCZ has joined #ruby
chalkmonster has joined #ruby
alfiemax has quit [Ping timeout: 256 seconds]
Ai9zO5AP has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
Ai9zO5AP has joined #ruby
TomyWork has quit [Remote host closed the connection]
gdonald has quit [Remote host closed the connection]
Ai9zO5AP has quit [Quit: WeeChat 2.7.1]
Ai9zO5AP has joined #ruby
jinmiaol2 has joined #ruby
znz_jp has quit [Remote host closed the connection]
znz_jp has joined #ruby
ChmEarl has quit [Quit: Leaving]
tpanarch1st has quit [Quit: Thanks for your help, nice to see you, take care.]
sergioro has joined #ruby
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mikecmpbll has quit [Ping timeout: 246 seconds]
mikecmpbll has joined #ruby
teardown has quit [Ping timeout: 256 seconds]
cliluw has quit [Ping timeout: 244 seconds]
<rickhull> havenwood: any thoughts on https://github.com/postmodern/ruby-install/pull/368
<rickhull> i think the travis failure is transient but I can't retrigger it
<havenwood> rickhull: +1, ruby-dev and llvm-dev make sense to me. the package deps have been a longstanding pain.
<havenwood> rickhull: why clang?
<rickhull> it was necessary, i think just debian package structure things
<rickhull> i don't recall exactly why
<havenwood> rickhull: aha
<havenwood> rickhull: We'll need a new release of ruby-install for Ruby 3, so that would be the milestone to target for getting this patch merged.
<havenwood> rickhull: (Ruby 3 drops .bz2 packages, hence need to cut a new release.)
<rickhull> related, i believe the rbx build procedure has changed, perhaps beyond the the dependencies.txt
<rickhull> judging from a postmodern comment circa 2016 i think
<rickhull> i'm not sure I can try to shepherd this through, as I'm currently messing around with nixos rather than debian/apt distros
<rickhull> manveru was working on building rbx on nixos as recently as 2019
TCZ has quit [Quit: Leaving]
finchfiler has joined #ruby
banisterfiend has joined #ruby
<rickhull> banisterfiend: hi there
<banisterfiend> yo ltns homie
<banisterfiend> wassup
<havenwood> o/
<rickhull> not a whole lot, been messing around with nixos and thinking about getting back into devops/cloud/infra stuff
<havenwood> rickhull: Rubinius feels to me like a fork these days, fwiw. I currently lean towards just removing it from ruby-install.
<rickhull> mruby is further even, right?
<havenwood> rickhull: Well, mruby targets the Ruby spec and purports to be a Ruby. Rubinius has chosen to be its own language explicitly.
<rickhull> i feel like if you can claim ruby 2.5 compatibility or whatever, ok
<havenwood> I guess brixen might say it supports the Ruby language and is a superset?
<rickhull> not sure what rbx says, something like that?
<banisterfiend> rickhull nice, i mainly do system level networking stuff these days, pretty close to ops i guess
<rickhull> banisterfiend what languages / environments are interesting?
<banisterfiend> rickhull hmm i do C++ and all 3 platforms (i work for a VPN company writing VPN software)
<banisterfiend> but linux is the most interesting of course :)
<rickhull> c++, wow, what's that like?
<banisterfiend> iproute2 is incredible, BPF, cgroups, all that jazz, multiple routing tables
<banisterfiend> rickhull moden C++ is totally incredible
<banisterfiend> i'm in love :)
<rickhull> The Good Parts (tm) ?
<rickhull> is that template programming and OOP stuff? or more functional?
<banisterfiend> well i'm quite new to c++ so i guess i managed to avoid a lot of the warts, and just know the modern way of oding things
<banisterfiend> but it's a great language these days
<rickhull> I believe it, because it absorbs things and moves forward
<banisterfiend> rickhull i'm mainly doing it in the Qt environment, so i get a lot of batteries included
<banisterfiend> pure OOP in my case
cliluw has joined #ruby
<banisterfiend> i'll show you our code base if you want, it's open source
<banisterfiend> rickhull https://github.com/pia-foss/desktop
<rickhull> what's a good entry point? if i want to read the code for understanding and not be blasted by environmental scaffolding
<rickhull> i'm starting with tests/
sergioro has quit [Quit: leaving]
banisterfiend has quit [Ping timeout: 240 seconds]
banisterfiend has joined #ruby
<banisterfiend> rickhull sorry, died. Check out this https://github.com/pia-foss/desktop/blob/master/daemon/src/win/win_firewall.h
<banisterfiend> we hvae a pretty nice wrapper around the windows filtering platform
<banisterfiend> if you wanna see some of the more low-level networking stuff i've been working on, you can check out the mac kernel extension
<banisterfiend> i also wrote the windows device driver for split tunneling https://github.com/pia-foss/desktop-windows-wfp-callout/blob/master/PiaWFPCallout/Driver.c
<banisterfiend> all that stuff is great fun, they're both kernel modules that intercept socket operations system-wide to rebind sockets to a different interface
<banisterfiend> Linux didn't need any of that jazz though, it has cgroups and multiple routing tables that are powerful enough
alfiemax has quit [Remote host closed the connection]
SeepingN has joined #ruby
<rickhull> ha, interesting. my biggest complaint is that when I look at the code, it looks like a lot of incidental fiddling with the machine, rather than modeling -- describing the problem and solution. I like higher level languages and working closer to the problem domain.
sergioro has joined #ruby
<banisterfiend> well the problem domain i enjoy is low-level bit fiddling :)
<rickhull> that said, I love tailor-making a solution that rips \m/
<banisterfiend> i was a "full stack web developer' for 5 yearrs and i fucking hated every second of it
<rickhull> I agree, there is something satisfying about manipulating the machine in an elegant and systematic way, optimizing for efficiency
<banisterfiend> product based development with "stakeholders" and endless meetings to figure out requirements is just mind numbing tedium to bring the bland vision of some cloying american to life
<banisterfiend> im more interested in the machine, and the low level apis, than what some douchebag thinks would be a great app to 'empower people' or whatever ;)
<rickhull> the machine is a lot more predictable than the users xD
<rickhull> or the stakeholders or w/e
<banisterfiend> (i'm still bitter :P)
Ai9zO5AP has quit [Ping timeout: 240 seconds]
<rickhull> it's the ozzies that brought to us the wonders of JIRA
Chris__ has joined #ruby
<banisterfiend> interesting
<banisterfiend> rickhull you used to be nwallins right?
<rickhull> side note, Atlassian is very good at a good couple things
<rickhull> yep
Chris__ is now known as tf2ftw_
buckworst has quit [Quit: WeeChat 2.8]
<banisterfiend> rickhull what's the panedemic like in NO?
Ai9zO5AP has joined #ruby
<banisterfiend> it's pretty bad here (in NL) we have a > 10% death rate, a few people on my street already died
<rickhull> I still have some friends there, haven't heard too much recently. I think it was spiked for Mardi Gras (Feb 20th or so)
sergioro has quit [Quit: leaving]
<rickhull> I'm in Atlanta now, and have been pretty sheltered for 5 weeks or so
<rickhull> maybe 6 or 7 :|
<rickhull> generally things are quiet here, with low traffic (BLESS) but still more traffic than you might expect
<rickhull> essentials stores are busy, parking lots generally rather full
<banisterfiend> it's old already
<banisterfiend> it was a weeny bit int4resting in the first few weeks
<banisterfiend> but now i really want to travel again, and that probably wont be allowed for a good few months i'd say
<rickhull> yes, it's very concerning for old folks though
<banisterfiend> i had a ticket booked to spain and a nice airbnb for 4 weeks just beforer the pandemic struck
<rickhull> like my parents, etc
<banisterfiend> yea
<banisterfiend> that's true
<banisterfiend> old peope here are pretty terrified
<banisterfiend> you see them in the supermarket wrarpped up in masks + gloves
<rickhull> I was going to go to a wedding in Puerto Rico, and now the poor couple is in a legal battle over the costs
<banisterfiend> brb have to test something real quick
<banisterfiend> stupid thing about worrking on VPNs is your internet connection breaks anytime you test anything :P
<rickhull> no one I know has died, but I know of deaths via 2 degrees or so
<rickhull> have you tried turning it off and then back on again?
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
banisterfiend has quit [Ping timeout: 244 seconds]
alfiemax has joined #ruby
cliluw has quit [Ping timeout: 260 seconds]
sergioro has joined #ruby
alfiemax has quit [Remote host closed the connection]
banisterfiend has joined #ruby
sergioro has quit [Client Quit]
sergioro has joined #ruby
buckworst has joined #ruby
buckworst has quit [Quit: WeeChat 2.8]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gix has quit [Disconnected by services]
banisterfiend has quit [Ping timeout: 240 seconds]
tf2ftw_ has quit [Quit: Leaving]
null____ has joined #ruby
null__ has quit [Ping timeout: 240 seconds]
null____ is now known as null__
Garb0 has quit [Ping timeout: 244 seconds]
SeepingN has joined #ruby
finchfiler has quit [Ping timeout: 260 seconds]
rickhull has quit [Ping timeout: 240 seconds]
sergioro has quit [Ping timeout: 265 seconds]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has quit [Ping timeout: 240 seconds]
kaleido has quit [Quit: peas]
kaleido has joined #ruby
sergioro has joined #ruby
Garb0 has joined #ruby
<havenwood> 8.times.map { 10 ** _1.div(3) * _1.modulo(3).abs2.succ }
<havenwood> I guess I should say: Array.new(8) { 10 ** _1.div(3) * _1.modulo(3).abs2.succ }
sparr has joined #ruby
<sparr> anyone here use vscode and willing to help me figure out how to get IDE-like features going for ruby? I'd prefer not to switch editors just to get "go to definition" and such.
<havenwood> sparr: gem install solargraph
<sparr> havenwood: I have the solargraph gem installed
<havenwood> sparr: Are you also using the extension?
<sparr> yes
<sparr> it has no visible effect
<sparr> nor any errors I can find in the Output panels
<havenwood> sparr: Does it do autocompletion? Can you right click and go to definition? Or is none of that working?
<havenwood> Or go to references.
<sparr> no autocompletion
<sparr> no "go to " anything in the right click menu
<sparr> it's like I'm editing plain text files
<sparr> syntax highlighting works, but that worked with stock vscode
<sparr> ok, after messing with my PATH and reloading the vscode window, now the extension appears to be trying to run the binary, and I have some errors in the output
<havenwood> sparr: Does the Solargraph extension seem to be enabled? No errors?
<sparr> Error: Cannot find module 'semver'
Furai has quit [Quit: WeeChat 2.8]
<sparr> semver was not one of the modules installed as a dependency of solargraph
<havenwood> sparr: If you open a Ruby file with VSCode from the terminal, does Solargraph load succesfully?
<havenwood> sparr: Like: code foo.rb
<sparr> no, it does not. looks like this node module dependency problem is blocking it from running
<sparr> I will investigate from here. Thanks!
<havenwood> np! good luck
banisterfiend has joined #ruby
<sparr> seems like a vscode problem, the dependency is there in the relevant node module
<sparr> it just didn't install it for some reason
<sparr> off to #vscode :)
<havenwood> sparr: I think it'll be exciting when Steep for VSCode is released. That'll be even more of an IDE-like experience with types. https://twitter.com/soutaro/status/1229747257580253184
<havenwood> sparr: It can spot type errors like: https://twitter.com/soutaro/status/1229042442952855556
LtHummus has joined #ruby
Furai has joined #ruby
banisterfiend has quit [Ping timeout: 256 seconds]
<al2o3-cr> ["\xf0?", "\x00@", "\x14@", "$@", "4@", "I@", "Y@", "i@"].map { ("\x0" * 6 << _1).unpack1('d').to_i }
conta has joined #ruby
lalitmee has joined #ruby
lalitmee has quit [Remote host closed the connection]
lalitmee has joined #ruby
plutes has quit [Quit: If you judge me now, you have judge me prematurely.]
plutes has joined #ruby
dfucci__ has joined #ruby
<havenwood> mmm
dfucci__ has quit [Quit: leaving]
dfucci__ has joined #ruby
banisterfiend has joined #ruby
imode has quit [Ping timeout: 260 seconds]
chihhsin has quit [Ping timeout: 250 seconds]
chouhoulis has quit [Remote host closed the connection]
lalitmee has quit [Remote host closed the connection]
chihhsin has joined #ruby
lalitmee has joined #ruby
banisterfiend has quit [Ping timeout: 244 seconds]
lalitmee has quit [Max SendQ exceeded]
lalitmee has joined #ruby
burgestrand has joined #ruby
lalitmee has quit [Max SendQ exceeded]
lalitmee has joined #ruby
cthu| has quit [Ping timeout: 246 seconds]
schne1der has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
dionysus69 has quit [Quit: dionysus69]
schne1der has quit [Remote host closed the connection]
dionysus69 has joined #ruby
lalitmee has quit [Remote host closed the connection]
conta has quit [Quit: conta]
PaulePanter has quit [Remote host closed the connection]
cd has quit [Quit: cd]
schne1der has joined #ruby
TomyWork has joined #ruby
d3bug has quit [Quit: Connection closed for inactivity]
SeepingN has joined #ruby
SeepingN has quit [Client Quit]
<sparr> havenwood: neat
<sparr> how can I determine the type/class of an object in ruby that does not have a .class or .methods method?
<sparr> or even just what properties it has?
ur5us has joined #ruby
masticass has quit [Ping timeout: 240 seconds]
conta has joined #ruby
jhass has quit [Quit: Bye]
masticass has joined #ruby
jhass has joined #ruby
Benett has quit [Quit:  ]
conta has quit [Quit: conta]
rcvalle_ has quit [Ping timeout: 240 seconds]
rcvalle has joined #ruby
chouhoulis has joined #ruby
chouhoulis has quit [Ping timeout: 256 seconds]
Benett has joined #ruby
ur5us has quit [Ping timeout: 244 seconds]
Garb0 has quit [Remote host closed the connection]
Garb0 has joined #ruby
Garb0 has quit [Read error: Connection reset by peer]
sergioro has quit [Quit: Lost terminal]
burgestrand has quit [Quit: burgestrand]
Guest1018 has joined #ruby
Guest1018 has quit [Client Quit]
burgestrand has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
burgestrand has quit [Quit: burgestrand]
Garb0 has joined #ruby
hassox has joined #ruby
Cork has quit [Quit: .]
hassox has quit [Ping timeout: 260 seconds]
arahael3 has joined #ruby
vondruch_ has joined #ruby
Cork has joined #ruby
arahael2 has quit [Ping timeout: 246 seconds]
vondruch has quit [Ping timeout: 264 seconds]
vondruch_ is now known as vondruch
conta has joined #ruby
conta has quit [Client Quit]
dionysus69 has joined #ruby
TCZ has joined #ruby
hassox has joined #ruby
cliluw has joined #ruby
jokester_ has quit [Quit: WeeChat 2.3]
mikecmpbll has quit [Ping timeout: 260 seconds]
hassox has quit [Ping timeout: 260 seconds]
cliluw has quit [Ping timeout: 244 seconds]
jokester has joined #ruby
mikecmpbll has joined #ruby
alfiemax has joined #ruby
hassox has joined #ruby
burgestrand has joined #ruby
me1 has joined #ruby
hassox has quit [Ping timeout: 260 seconds]
burgestrand has quit [Quit: burgestrand]
me1 is now known as sergushakov
alexherbo2 has joined #ruby
Ai9zO5AP has quit [Ping timeout: 240 seconds]
fercell has joined #ruby
tty1_ has joined #ruby
dhollinger has quit [Ping timeout: 246 seconds]
dhollinger has joined #ruby
conta has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
Ai9zO5AP has joined #ruby
drincruz_ has joined #ruby
conta has quit [Quit: conta]
jinie has quit [Ping timeout: 265 seconds]
jinie has joined #ruby
Garb0 has quit [Remote host closed the connection]
drincruz_ has quit [Ping timeout: 260 seconds]
drincruz_ has joined #ruby
dhollinger has quit [Ping timeout: 246 seconds]
gordie has joined #ruby
<gordie> Hi ! Can I create a "subproperty" in a single line, like myobject.prop1.prop2.prop3.prop4 = "foo" ?
dhollinger has joined #ruby
<jhass> gordie: with enough ; you can do everything in a single line :P
<jhass> but no, I don't think there's a sane way to do that
<jhass> I mean what use would a bunch of classes have that hold a single value each which is just another such wrapper anywayss
burningserenity has joined #ruby
dhollinger has quit [Ping timeout: 256 seconds]
<sergushakov> ((obj['a'] = {})['b'] = {})['c'] = 1 hash for example
dhollinger has joined #ruby
<jhass> mmh, I guess I could dig out that recursive openstruct hack again
gordie has quit [Remote host closed the connection]
burningserenity has quit [Remote host closed the connection]
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
hcann has joined #ruby
jnix has joined #ruby
burningserenity has joined #ruby
jinmiaol2 has quit [Remote host closed the connection]
jinmiaol2 has joined #ruby
x0n has quit [Ping timeout: 265 seconds]
alexherbo26 has joined #ruby
alexherbo2 has quit [Ping timeout: 246 seconds]
alexherbo26 is now known as alexherbo2
alexherbo2 has quit [Client Quit]
TCZ has quit [Quit: Leaving]
jinmiaol2 has quit [Ping timeout: 260 seconds]
Esa__ has joined #ruby
jinmiaol2 has joined #ruby
x0n has joined #ruby
burningserenity has quit [Ping timeout: 244 seconds]
alexherbo2 has joined #ruby
hcann has left #ruby [#ruby]
Esa__ has quit [Ping timeout: 246 seconds]
alfiemax has quit [Remote host closed the connection]
burningserenity has joined #ruby
jinmiaol2 has quit [Ping timeout: 264 seconds]
jinmiaol2 has joined #ruby
jinmiaol2 has quit [Read error: Connection reset by peer]
MadLamb has joined #ruby
<MadLamb> Can someone recommend me profiling tools for memory in Ruby? I'm looking for something like https://datadog-docs.imgix.net/images/tracing/profiling/profile.ab77fff7572008c69e92c54ccd98887f.png?auto=format or https://miro.medium.com/max/3204/1*5IPJg9pKhHBKYXRPBwGGHw.png
jinmiaol2 has joined #ruby
TCZ has joined #ruby
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
ellcs has joined #ruby
alexherbo2 has joined #ruby
burningserenity has quit [Remote host closed the connection]
fercell has quit [Quit: WeeChat 2.8]
sergioro has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.8]
jinmiaol2 has quit [Ping timeout: 260 seconds]
jinmiaol2 has joined #ruby
burningserenity has joined #ruby
<havenwood> MadLamb: rack-mini-profiler with flamegraph and stackprof.
<havenwood> MadLamb: or if it's not Rack, just plain memory_profiler.
<havenwood> MadLamb: JRuby has more directly equivalent options.
<havenwood> MadLamb: JRuby's --profile is nifty, or tools like VisuaVM work great.
Rakko has joined #ruby
mikecmpbll has quit [Ping timeout: 246 seconds]
hassox has joined #ruby
mikecmpbll has joined #ruby
hassox has quit [Client Quit]
imode has joined #ruby
Xiti has quit [Read error: Connection reset by peer]
Xiti has joined #ruby
rippa has joined #ruby
xissburg has joined #ruby
ChmEarl has joined #ruby
<xissburg> I'm trying to do `rvm install ruby-2.4-head` and running into a pile of issues
<xissburg> *** using http instead of https ***
lxsameer has quit [Ping timeout: 256 seconds]
<xissburg> redirection forbidden: http://repo.or.cz/official-gcc.git/blob_plain/HEAD:/config.guess -> https:...
<havenwood> xissburg: Is it not a fresh RVM install then? It should be HTTPS.
<havenwood> xissburg: Ruby 2.4 is past end of life.
<xissburg> I just did `rvm get stable`
<xissburg> hmm I don't know what version I should install
<havenwood> xissburg: rvm get head && rvm install ruby
<xissburg> it's just that this gem required >=2.4 so...
<xissburg> let me try...
jinmiaol2 has quit [Ping timeout: 260 seconds]
arcaos has quit [Ping timeout: 244 seconds]
gzc has quit [Quit: WeeChat 2.8]
arcaos has joined #ruby
Rakko has quit [Quit: Leaving]
Xiti` has joined #ruby
dfucci___ has joined #ruby
d3bug has joined #ruby
dfucci__ has quit [Ping timeout: 264 seconds]
Xiti has quit [Ping timeout: 246 seconds]
Rakko has joined #ruby
TomyWork has quit [Remote host closed the connection]
Rakko has quit [Quit: Leaving]
burgestrand has joined #ruby
vondruch_ has joined #ruby
vondruch has quit [Ping timeout: 260 seconds]
vondruch_ is now known as vondruch
cthu| has joined #ruby
<xissburg> that works... thanks :)
Xiti` has quit [Quit: Leaving]
Xiti has joined #ruby
imode has quit [Ping timeout: 256 seconds]
lxsameer has joined #ruby
greypack has quit [Ping timeout: 260 seconds]
greypack has joined #ruby
<apotheon> 08:27 < sparr> how can I determine the type/class of an object in ruby that does not have a .class or .methods method?
<apotheon> sparr: You could try #to_s I suppose.
<apotheon> sparr: p foo # That can do the same thing, but as printed output from a program, for an object instance foo.
<apotheon> sparr: That'll give you the class of the object.
<apotheon> sparr: Unless you're building a new object hierarchy off of BasicObject, though, I'm not sure how you'd end up with an object that doesn't have #class or #methods.
<havenwood> sparr: #class and #method are defined on Kernel, which is mixed into Object, so they're *always* available.
<havenwood> apotheon: Yeah, BasicObject is the exception.
TCZ has quit [Quit: Leaving]
<havenwood> So not absolutely *always*, but practically pretty much everything is an object so #class and #method are rightly presumed to be defined.
<havenwood> &>> ObjectSpace.each_object.grep_v(Object)
<rubydoc> # => [] (https://carc.in/#/r/8zcf)
cd has joined #ruby
MadLamb has quit [Read error: Connection reset by peer]
dviola has joined #ruby
<havenwood> sparr: In Ruby 3, further type signatures are planned: https://github.com/ruby/ruby-signature#rubysignature
<havenwood> sparr: Steep and other type checkers use these.
hiroaki has joined #ruby
<havenwood> sparr: ruby-signature will ship with Ruby 3 as a bundled gem.
<kaleido> ruby3 got a release date?
<havenwood> kaleido: It's still tentatively Christmas 2020.
<havenwood> Matz hasn't renamed ruby-2.8.0-dev to ruby-3.0.0-dev, so we'll see if it slips a year, but most new features seem to be roughly on track.
<havenwood> Matz has said he'll decide whether it's ready for 3.0 this year, and if so rename the version.
<havenwood> kaleido: It's a very good bet it'll be Christmas 2020 or Christmas 2021.
<havenwood> kaleido: It seems 2020 is possible, but it'll depend on Guilds, Async Scheduler, and Signature work all going smoothly.
<kaleido> nice
<havenwood> kaleido: Here's a good summary of the non-blocking I/O scheduler work that ioquatix is doing: https://www.codeotaku.com/journal/2020-04/ruby-concurrency-final-report/index
<havenwood> (Very exciting work.)
<havenwood> kaleido: Stay tuned for the Ruby Kaigi keynote by Soutaro on Ruby::Signature.
<apotheon> havenwood: Is #class implemented in C or in Ruby?
<havenwood> apotheon: C
<apotheon> I had a feeling . . .
<havenwood> apotheon: A trick to find out is to check its #source_location, since methods in C don't have one.
<kaleido> oh wow the scheduler stuff seems intriguing
<havenwood> apotheon: Or show-source in Pry.
<apotheon> Ah, #source_location is a good one. Thanks.
<havenwood> kaleido: It's already showing great promise with Falcon and libs like async-http and async-websockets.
<apotheon> havenwood: Do you know when BasicObject became a thing? I seem to recall in (now really old) previous versions of Ruby there wasn't a BasicObject.
<apotheon> Maybe I just never noticed it way back when.
<apotheon> s/way back when/way-back-when/
<havenwood> apotheon: 1.9
<apotheon> Okay. That seemed like the obvious time for that to appear, but I didn't want to just assume.
<apotheon> Was it actually in 1.9.0, or was it in something like 1.9.2 (the same time as the license change)?
<havenwood> apotheon: Yeah, the 1.8 to 1.9 change from an interpreter to a VM was just a huge amount of breaking changes.
<apotheon> I remember that.
<havenwood> apotheon: 1.9.1 is the ABI number for 1.9.
<apotheon> ah
<havenwood> apotheon: All of 1.9 was basically a 2.0-pre with some strange versioning.
<apotheon> I remember that, too.
<havenwood> Things thereafter ironed out into roughly semantic versioning.
<havenwood> And patch numbers got dropped from versions.
<apotheon> I really liked the changes for 1.9.x.
<havenwood> kaleido: This is a great example of how non-blocking I/O can work with the new parallelism constructs of Guild/Isolate and Channels: https://www.codeotaku.com/journal/2019-12/ruby-concurrency-progress-report/index
<havenwood> apotheon: A big speedup too!
<apotheon> Yeah, that was one of the changes I liked about it.
<apotheon> I didn't get around to doing anything with 1.9.x until 1.9.2, which coincidentally seemed to be where some things stabilized, too.
<apotheon> (judging by what I was reading about it at the time)
<havenwood> apotheon: 1.9 coincided with when I decided to become a Rubist, so I just had a few years of turbulence with 1.8 lingering but mostly learned on 1.9 and tried to avoid 1.8.
<apotheon> That seems like it was a good way to get in.
<havenwood> The changes since then have been fairly easy to track.
chouhoulis has joined #ruby
<apotheon> I don't follow breaking news about pretty much *anything*, so I don't track changes as well as you.
<kaleido> i bought a book years back and on the cover in big bold type read "Now using Ruby 1.9!"
<havenwood> \o
<apotheon> Anything important enough that I absolutely *must* know it, the missus will tell me (e.g. she told me about when the local quarantine lockdown would start).
<apotheon> I wonder if I have any Ruby book editions that say that about 1.9 . . .
<havenwood> kaleido: Soon that'll happen again with, "Now with Ruby 3.0!"
<apotheon> yep
<apotheon> I'm looking forward to fixing breakage in my code.
<havenwood> "Parallel, Non-blocking Typed I/O with Ruby 3.0 For Dummies" book coming soon.
<apotheon> I just recently realized that I already have breakage in my code, in one project, between 2.4.5 and 2.6.5 somewhere (I don't recall the exact versions on either side of the break), so I've gotta fix that now.
<apotheon> havenwood: That seems like a fun book.
greypack has quit [Ping timeout: 260 seconds]
greypack has joined #ruby
cliluw has joined #ruby
cliluw has quit [Ping timeout: 244 seconds]
cliluw has joined #ruby
dfucci___ has quit [Ping timeout: 260 seconds]
gix has joined #ruby
SeepingN has joined #ruby
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
Garb0 has joined #ruby
Xiti` has joined #ruby
Pixi__ has joined #ruby
hiroaki has quit [Ping timeout: 260 seconds]
Xiti has quit [Ping timeout: 260 seconds]
Xiti` has quit [Ping timeout: 246 seconds]
Xiti has joined #ruby
Xiti` has joined #ruby
Pixi__ has quit [Ping timeout: 246 seconds]
Xiti has quit [Ping timeout: 246 seconds]
Xiti has joined #ruby
felix_221986 has joined #ruby
Xiti` has quit [Ping timeout: 246 seconds]
hiroaki has joined #ruby
burgestrand has quit [Quit: burgestrand]
burgestrand has joined #ruby
burgestrand has quit [Client Quit]
tau has joined #ruby
MadLamb has joined #ruby
<MadLamb> havenwood, thanks but I was looking for tools similar to those.
<MadLamb> havenwood, and visualvm is a java tool
<MadLamb> havenwood, :D
<MadLamb> havenwood, the first one you recommended kinda works but i would like this constant running profilers
tau has quit [Read error: Connection reset by peer]
<MadLamb> havenwood, its nice to know its called flamegraph
ldepandis has joined #ruby
kristian_on_linu has joined #ruby
Ai9zO5AP has quit [Ping timeout: 240 seconds]
Xiti` has joined #ruby
Pixi__ has joined #ruby
Ai9zO5AP has joined #ruby
Xiti has quit [Ping timeout: 258 seconds]
Xiti` has quit [Ping timeout: 246 seconds]
Xiti` has joined #ruby
imode has joined #ruby
Xiti has joined #ruby
Pixi__ has quit [Ping timeout: 240 seconds]
Garb0 has quit [Read error: Connection reset by peer]
Garb0 has joined #ruby
Xiti has quit [Client Quit]
Bounga has joined #ruby
Xiti` has quit [Ping timeout: 256 seconds]
burningserenity has quit [Remote host closed the connection]
Xiti has joined #ruby
Garb0 has quit [Read error: Connection reset by peer]
Garb0 has joined #ruby
Garb0 has quit [Max SendQ exceeded]
Garb0 has joined #ruby
MadLamb has quit [Remote host closed the connection]
CrazyEddy has quit [Ping timeout: 240 seconds]
alexherbo2 has joined #ruby
CrazyEddy has joined #ruby
entel has quit [Quit: Connection closed for inactivity]
davispuh has joined #ruby
robotmay has quit [Remote host closed the connection]
robotmay has joined #ruby
tau has joined #ruby
<havenwood> I meant VisualVM for JRuby. :)
xissburg has quit [Quit: ZZZzzz…]
dionysus69 has quit [Quit: dionysus69]
dhollinger has quit [Ping timeout: 258 seconds]
dhollinger has joined #ruby
tau has quit [Remote host closed the connection]
alfiemax has joined #ruby
greengriminal has joined #ruby
troulouliou_div2 has joined #ruby
<greengriminal> Hey Rubyist, if you have method that is defined with a `!` this denotes that it is intended to have a side-affect. What are your thoughts on having a predicate method defined inside of this. My question is which would you consider correct. https://gist.github.com/davidpatters0n/f690e6450ca3f0e0c5e65a911233cf24
alfiemax has quit [Ping timeout: 260 seconds]
Xiti has quit [Quit: Leaving]
<adam12> greengriminal: I probably wouldn't care if it was either way, but I'd probably mostly care about the public API. If `operations!` is the only publicly exposed method, then I'd probably prefer the first.
<jhass> First of all I wouldn't put the notion of ! as strictly side effect vs no side effect. IMO a non-bang method having a side effect is perfectly normal and reasonable. Ruby stdlib uses ! methods for methods that modify the receiver rather than returning a modified copy of the receiver. Rails uses to denote variants of methods that raise where the non-bang version maybe just returns nil, think create vs
<jhass> create!. In either case you can see that most people don't define a bang method when there's no sense to a non-bang counterpart
<adam12> and +1 for jhass's comment.
<jhass> in other words foo is normal, foo! is a special variant
<jhass> it doesn't tell how it's special, just a general notion of "more dangerous"
<jhass> now mentally removing all the ! from your examples, I think it's a bit hard to judge because it's too generified
<jhass> I can't quite make out the distinction between operations and send_message, especially if both are public API
<jhass> and also whether send_message? is computing based on the API consumer or library internal state
<jhass> so it's a bit hard to judge
<jhass> and yeah, whether both are public or not is quite important to the question
<jhass> public in the sense of meant to be called by the user of the API
dfucci_ has joined #ruby
felix_221986 has quit [Quit: Connection closed]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
kinduff has quit [Read error: Connection reset by peer]
<apotheon> greengriminal: I'd prefer a verb as the method name for something that changes things so, for instance, send_message! seems a better name than operations!. On the other hand, I'm not really sure what operations! does other than call send_message!, so it's difficult to be sure it isn't a somewhat reasonable name.
dfucci_ is now known as dfucci
kinduff has joined #ruby
<apotheon> greengriminal: If the only way send_message will ever be used is if send_message? returns a truthy value, the conditional execution should be in send_message! as in the second example.
<greengriminal> I should've mentioned whether this was a public API or not. It is not this is all private internal logic that isn't exposed publicly.
<apotheon> Even so, I'd name things according to the idea that if your method is *doing* something it should be a verb method name.
<apotheon> I'm less insistent on something that just returns the value of a variable being a verb, though.
cliluw has quit [Ping timeout: 246 seconds]
<apotheon> My take on how to write this doesn't seem to change regardless of whether it's public or private API stuff.
cliluw has joined #ruby
<greengriminal> Got it.
<greengriminal> cheers for the input all.
<apotheon> jhass: "Ruby stdlib uses ! methods for methods that modify the receiver rather than returning a modified copy of the receiver." <- That's basically just the standard case of a side effect method.
<apotheon> . . . but yeah, Rails has its own way of doing things.
<jhass> apotheon: yes. yet we got File.write and not File.write!
<jhass> it's to disambiguate the side effect if necesssary
<apotheon> greengriminal: I think jhass and adam12 are pretty much on the money with the idea that something that is naturally only going to have a side-effect version doesn't need to be a bang method, though.
<jhass> it just so happens stdlib basically has no usecases beyond the "modify receiver" mechanic
<apotheon> The more generalized description of it that I've seen is something like "a bang method is the 'dangerous' version of a non-bang method".
<greengriminal> Yeah I do agree with that too.
<apotheon> Operator-style methods don't follow that rule of thumb at all, though (e.g. + vs. << for arrays).
golevka has joined #ruby
<apotheon> Also . . . more indentation might have helped make that gist more readable.
Xiti has joined #ruby
mikecmpbll has quit [Ping timeout: 260 seconds]
dfucci has quit [Ping timeout: 264 seconds]
mikecmpbll has joined #ruby
<havenwood> Plenty of non-bang methods modify the receiver. Matz says it means more "dangerous." In the Ruby stdlib, it's often used where a "safer" version doesn't modify the receiver and a more "dangerous" one does. It doesn't make sense to have a bang version without a safer non-bang one. I've seen a bang method defined without counterpart but that's off the rails.
g0tcha has joined #ruby
<havenwood> alternatively end your method names in a more expressive emoji.
<havenwood> def grocery_shopping😷
<g0tcha> hey guys, quick question, i installed ruby 2.7.0 on ubuntu 20.04 to run redmine, redmine requires ruby between 2.3.0 and > 2.7.0 .. i installed ruby 2.6.3 but redmine is still complaining about 2.7.0
<g0tcha> how can i make it so it uses 2.6.3 instead of 2.7.0?
<bhaak> now I have an urge to add a method ending in lighting to the production code
howdoi has joined #ruby
havenwood has quit [Quit: ZNC 1.7.5 - https://znc.in]
banisterfiend has joined #ruby
havenwood has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
arcaos has quit [Read error: No route to host]
arcaos has joined #ruby
<g0tcha> any thoughts?
<havenwood> g0tcha: How'd you install 2.7? Package? Built from source?
<g0tcha> havenwood, package
<g0tcha> ruby-full
ellcs has quit [Ping timeout: 240 seconds]
<havenwood> g0tcha: sudo apt-get install ruby-switch
<havenwood> g0tcha: ruby-switch --list
<havenwood> g0tcha: Or a switcher like chruby will also work.
<g0tcha> ruby-switch does not exist
<havenwood> g0tcha: Or you an manually setup PATH for Ruby and RubyGems and GEM_HOME, GEM_PATH, RUBY_ROOT, etc.
<g0tcha> havenwood, can it be done using rvm?
<havenwood> g0tcha: Ahh. Sec.
<havenwood> g0tcha: No, you can't switch to a package-installed Ruby with RVM. You *can* install a Ruby and switch to it with RVM.
<havenwood> g0tcha: What are you doing? Setting up a dev or prod box?
<havenwood> g0tcha: Many of us in the channel use chruby to switch versions.
<g0tcha> havenwood, its to install Redmine.. for personal use
<havenwood> g0tcha: Here's a guide for chruby with Ubuntu: https://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you
Garb0 has quit [Read error: Connection reset by peer]
<havenwood> g0tcha: That ^ guide has you install Ruby from source with a tool, but it *just works*.
Garb0 has joined #ruby
<havenwood> g0tcha: Alternatively, does you package-installed Ruby of an earlier version have a suffix on commands, like?: ruby26 -v
<havenwood> g0tcha: Is there a newer version of RedMine? Latest 2.6 is 2.6.6.
<g0tcha> hmm.. i dont know about ruby hehehe but what i do is run 'ruby --version' to get the version if thats what you mean
<g0tcha> yeah, Redmine 4.1.1
<havenwood> g0tcha: ruby26 --version
<havenwood> g0tcha: Does that ^ command exist?
<g0tcha> but it requires ruby 2.6
<g0tcha> hold on
<g0tcha> havenwood, no, it does not exist
<havenwood> g0tcha: What do you get for?: which -a ruby
greypack has quit [Quit: All your IRC are belong to ZNC]
<havenwood> g0tcha: Just one Ruby?
<havenwood> g0tcha: It's 2.7?
<havenwood> g0tcha: ruby --version
<g0tcha> i get 3 lines when i run 'which - ruby'
<havenwood> g0tcha: What are they?
<g0tcha> yeah, ruby --version shows 2.7.0
<g0tcha> the lines?
<g0tcha> one sec
<havenwood> g0tcha: It looks like you've installed rbenv and it's inserting 2.7 in front of your system Rubies.
<g0tcha> havenwood, ok.. so what do you suggest?
<g0tcha> start from scratch and install the version i want from source?
<havenwood> g0tcha: Yeah, tearing down cruft and starting fresh makes sense.
<havenwood> g0tcha: Or move forward with rbenv. There are many ways to do it.
<havenwood> g0tcha: chruby, RVM, rbenv, and the general purpose asdf are the most popular switchers.
TCZ has joined #ruby
<g0tcha> how does chruby works?
<havenwood> g0tcha: chruby is quite minimalist and flexible, so many of us here use that—but there are also RVM, rbenv, and asdf users.
<havenwood> g0tcha: chruby sets environment variables.
<havenwood> g0tcha: the guide I linked above ^ shows chruby setup on Ubuntu.
<havenwood> g0tcha: You can uninstall rbenv with: rm -rf `rbenv root`
<havenwood> g0tcha: I'd pick between chruby, RVM, rbenv and asdk or use update-alternatives or ruby-switch with a package.
<g0tcha> this is like the 5th time i install redmine in the past 5-6 years and every time i run into this problem with installing ruby lol
<havenwood> g0tcha: In case that's not enough options, Brightbox maintains a 2.6 package: https://www.brightbox.com/docs/ruby/ubuntu/
<g0tcha> thats more than enough options, its how to use these options
<havenwood> g0tcha: follow the chruby guide linked above. if you really want 2.6.3: ruby-install --latest ruby 2.6.3
<g0tcha> i think ill just start from scratch and install the version i need from source
<g0tcha> its getting too complicated
Emmanuel_Chanel has quit [Quit: Leaving]
<havenwood> g0tcha: That sounds prudent. A fresh install with env vars setup manually or via chruby works great.
DTZUZU2 is now known as DTZUZU
<g0tcha> yeah.. and probably take good notes so this doesnt happen again
<g0tcha> im trying one last time using ruby-install
<havenwood> g0tcha: Good luck! I expect it'll work well.
<g0tcha> thank you!
gdonald has joined #ruby
alfiemax has joined #ruby
dhollinger has quit [Ping timeout: 256 seconds]
dhollinger has joined #ruby
Emmanuel_Chanel has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
<havenwood> g0tcha: any time!
alexherbo2 has quit [Ping timeout: 240 seconds]
schne1der has quit [Ping timeout: 260 seconds]
TCZ has quit [Quit: Leaving]
greypack has joined #ruby
ur5us has joined #ruby
drincruz_ has quit [Ping timeout: 260 seconds]
greypack has quit [Quit: All your IRC are belong to ZNC]
greypack has joined #ruby
greypack has quit [Client Quit]
greypack has joined #ruby
Garb0 has quit [Read error: Connection reset by peer]
Garb0 has joined #ruby
g0tcha has quit [Ping timeout: 256 seconds]
TCZ has joined #ruby
banisterfiend has quit [Ping timeout: 244 seconds]
banisterfiend has joined #ruby
ur5us has quit [Ping timeout: 244 seconds]
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
ericm has joined #ruby