adam12 changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 2.7.2, 2.6.6, 3.0.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.org | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | BLM <3
teardown_ has joined #ruby
fanta1 has quit [Remote host closed the connection]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
bsdbandit-01 has joined #ruby
mnathani has joined #ruby
teardown has quit [Ping timeout: 240 seconds]
NewAlexandria has quit [Ping timeout: 256 seconds]
TCZ has joined #ruby
bsdbandit-01 has quit [Quit: -a- Connection Timed Out]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
teardown has joined #ruby
fippy has quit [Ping timeout: 265 seconds]
teardown_ has quit [Ping timeout: 240 seconds]
fippy has joined #ruby
hiroaki has quit [Ping timeout: 246 seconds]
prion has joined #ruby
postmodern has joined #ruby
teardown_ has joined #ruby
Rudd0 has quit [Ping timeout: 268 seconds]
teardown has quit [Ping timeout: 240 seconds]
teardown has joined #ruby
teardown_ has quit [Remote host closed the connection]
bsdbandit-01 has joined #ruby
ur5us has joined #ruby
teardown has quit [Ping timeout: 240 seconds]
bsdbandit-01 has quit [Read error: Connection reset by peer]
teardown has joined #ruby
bsdbandit-01 has joined #ruby
ur5us has quit [Quit: Leaving]
harlin has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
swaggboi has quit [Ping timeout: 260 seconds]
swaggboi has joined #ruby
mnathani has quit []
TCZ has quit [Remote host closed the connection]
uplime has quit [Ping timeout: 260 seconds]
uplime has joined #ruby
d10n-work has quit [Ping timeout: 260 seconds]
nowz has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
canton7 has quit [Ping timeout: 260 seconds]
canton7_ has joined #ruby
canton7_ is now known as canton7
d10n-work has joined #ruby
nowz has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
prion has quit [Ping timeout: 240 seconds]
aremaref has quit [Ping timeout: 246 seconds]
ur5us has quit [Ping timeout: 260 seconds]
aremaref has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
aremaref has quit [Ping timeout: 260 seconds]
bsdbandit-01 has joined #ruby
ChmEarl has quit [Quit: Leaving]
aremaref has joined #ruby
aremaref has quit [Ping timeout: 260 seconds]
moldorcoder7 has quit [Ping timeout: 240 seconds]
moldorcoder7 has joined #ruby
Rudd0 has joined #ruby
cnsvc has quit [Remote host closed the connection]
cnsvc has joined #ruby
akem_ has joined #ruby
MadeInChina has quit [Ping timeout: 260 seconds]
aremaref has joined #ruby
Technodrome has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
aremaref has quit [Ping timeout: 240 seconds]
prion has joined #ruby
Swyper has joined #ruby
_whitelogger has joined #ruby
cnsvc has quit [Quit: WeeChat 2.9]
Swyper has quit [Remote host closed the connection]
akem_ has quit [Ping timeout: 240 seconds]
akem has joined #ruby
akem_ has joined #ruby
Swyper has joined #ruby
akem has quit [Ping timeout: 260 seconds]
cnsvc has joined #ruby
Swyper has quit [Ping timeout: 260 seconds]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
wald0 has quit [Quit: Lost terminal]
aremaref has joined #ruby
aremaref has quit [Ping timeout: 272 seconds]
aremaref has joined #ruby
Nightmare has quit [Ping timeout: 260 seconds]
prion has quit [Ping timeout: 260 seconds]
Nightmare has joined #ruby
gavlee has quit [Ping timeout: 246 seconds]
mozzarella has quit [Read error: Connection reset by peer]
sol1d has quit [Ping timeout: 260 seconds]
fippy_ has joined #ruby
fippy has quit [Ping timeout: 246 seconds]
teardown has quit [Ping timeout: 240 seconds]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nofxx_ has joined #ruby
nofxx__ has quit [Ping timeout: 256 seconds]
aremaref has quit [Ping timeout: 256 seconds]
ramfjord has joined #ruby
aremaref has joined #ruby
Rudd0 has quit [Remote host closed the connection]
aremaref has quit [Ping timeout: 268 seconds]
sol1d has joined #ruby
<arahael> Hmm, by chance, what's ruby's recursion limit dependant on?
<arahael> (A fixed depth limit, like Python, or say, available memory?)
mozzarella has joined #ruby
<leftylink> hmm
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<leftylink> dang, tryng to use caller to find out, but having trouble
<leftylink> oh wait
<leftylink> don't need caller, just pass an increasing conter
<leftylink> right right
elcuervo has quit [Read error: Connection reset by peer]
<leftylink> &>> def f(a); @a=a; f(a+1) end; begin; f(0); rescue SystemStackError; end; @a
<rubydoc> # => 10919 (https://carc.in/#/r/a511)
<leftylink> that... is roughly the same as it is on my computer, but not exactly
<leftylink> interesting
<leftylink> coincidence, or not...
<leftylink> ah, I as running in irb
<leftylink> if I run with ruby -e, then it's 10919
<leftylink> which suggests that it is not dependent on the particulars of a computer
elcuervo has joined #ruby
<arahael> Which implies it's indeed a fixed number.
<arahael> I'm doing advent of code day 10 in ruby, and I decided to do it recursively.
<arahael> (Ie, with a recursive algo)
<nakilon> arahael are you sure you need to increase it?
<arahael> nakilon: No, I was just curious. I doubt this woudl work as-is in python, as an example, and I'm far more familiar with python than ruby.
<nakilon> didn't read the task yet, wait a sec
<arahael> As it turns out, it surprisingly worked just fine in ruby, at least for the examples. But it's too slow for the real data, so I'm currently learning about the profiler.
<nakilon> arahael try this anyway https://stackoverflow.com/a/27510458/322020
<arahael> And making my algorithm more efficient.
<arahael> nakilon: I'm not particularly interested in doing hacky things for an example thing like this, but thanks anyway.
<nakilon> how is it hacky?
<nakilon> it's an env var
<arahael> Hmm, yes, but what if you pick a number that's more than the available memory? I've killed the script so far when it hit about 11 GB and I'm optimising it now.
<arahael> And I was wondering: "Is it using 11 GB because it's recursing and recursing?"
<leftylink> the question is moot anyway for this particular problem. if there were going to be so many calls that it would overflow the stack, it was going to be too slow for solving the problem anyway
<arahael> leftylink: Indeed.
<nakilon> there are ways to check own mem usage from ruby so it can report it or die when it's too big
<arahael> nakilon: Yeah, it's not really the direction I'm going. I really was *curious* when I asked, not "Hey, damn it, I'm thinking of hitting a recursion limit and silly ruby is stopping me". ;)
<arahael> ( leftylink has the right idea )
<arahael> Hmm, my array.map seems to be consuming most of the time.
<nakilon> unless it's a bug in your program it's ok to increase default stack limit if the solution will be found at 11000 depth
<arahael> Hmm, looping over the array manually is *far* faster than doing a .map and then adding each item up.
<arahael> nakilon: I didn't really know if the recursion limit was going to be a problem, though.
<nakilon> but the fact that it took 11gb of ram hints that there is something wrong and may be an infinite recursion
bitstalker_ has quit [Read error: Connection reset by peer]
aremaref has joined #ruby
<arahael> Not infinite recursion, but I was actually storing the solutions it found, and as it turns out, teh problem doesn't actually require the solutions.
<nakilon> on my machine programs without a such bugs never go beyond 5gb, they become slow at that point and some garbage collector does not them to eat more
<arahael> Part of the problem is that I actually thought of the algorithm, and implemented it, as if I was writing haskell. :(
<nakilon> so to eat this much you have to do too much allocations
<arahael> (And writing $LANG_X in $LANG_Y is never good)
<nakilon> "I didn't really know if the recursion limit was going to be a problem"
<nakilon> that's what the recursion kind of is for -- to halt the program if it goes insane
<nakilon> *recursion limit
<arahael> Yeah, it hadn't yet halted.
<arahael> What leftylink basically told me, though, is that ruby's recursion limit is 1) predefined and constant, and 2) Far, far larger than python's.
<arahael> Python's default recursion limit is like, 1000.
<arahael> Now got this going in ~23 MB at the moment, just taking _forever_, so I might well hit ruby's recursion limit. But it's taking forever.
<nakilon> that's just a random choice of Guido and Matz
aremaref has quit [Ping timeout: 272 seconds]
<arahael> As it turns out, I only recurse to a depth of 107.
<arahael> However, I probably have 107! calls.
ur5us has joined #ruby
<arahael> The ruby profile is very good. :)
<arahael> *profiler
gavlee has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
al2o3-cr has quit [Ping timeout: 256 seconds]
ur5us has quit [Ping timeout: 260 seconds]
braincrash has joined #ruby
panorain has joined #ruby
dittonedo has joined #ruby
aremaref has joined #ruby
aremaref has quit [Ping timeout: 260 seconds]
cnsvc has quit [Ping timeout: 240 seconds]
dittonedo has quit [Ping timeout: 264 seconds]
dittonedo has joined #ruby
Rudd0 has joined #ruby
cd has quit [Quit: cd]
fanta1 has joined #ruby
dittonedo45 has joined #ruby
dittonedo has quit [Remote host closed the connection]
Learner has quit [Remote host closed the connection]
aremaref has joined #ruby
aremaref has quit [Ping timeout: 260 seconds]
dittonedo45 has quit [Quit: dittonedo45]
naftilos76 has joined #ruby
ur5us has joined #ruby
evdubs_ has joined #ruby
evdubs has quit [Ping timeout: 240 seconds]
evdubs_ is now known as evdubs
TCZ has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
ur5us has quit [Ping timeout: 260 seconds]
pwnd_sfw2 has joined #ruby
pwnd_sfw has quit [Read error: Connection reset by peer]
pwnd_sfw2 is now known as pwnd_sfw
ellcs has joined #ruby
aremaref has joined #ruby
aremaref has quit [Ping timeout: 264 seconds]
ellcs has quit [Ping timeout: 260 seconds]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
bsdbandit-01 has joined #ruby
Technodrome has joined #ruby
bsdbandit-01 has quit [Ping timeout: 268 seconds]
prion has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
dittonedo has joined #ruby
bsdbandit-01 has joined #ruby
al2o3-cr has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
cognemo has quit [Quit: cognemo]
cognemo has joined #ruby
akem_ is now known as MadeInLatvia
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dittonedo has quit [Remote host closed the connection]
panorain has quit [Remote host closed the connection]
Technodrome has joined #ruby
panorain has joined #ruby
aremaref has joined #ruby
TomyLobo has joined #ruby
aremaref has quit [Ping timeout: 246 seconds]
ramfjord has quit [Ping timeout: 246 seconds]
weaksauce has quit [Ping timeout: 264 seconds]
Swyper has joined #ruby
GodFather_ has joined #ruby
TCZ has quit [Quit: Wawel - Czujesz sie dobrze, czynisz dobrze]
ChmEarl has joined #ruby
lucasb has joined #ruby
nofxx has joined #ruby
bsdbandit-01 has joined #ruby
nofxx_ has quit [Ping timeout: 260 seconds]
somazero has joined #ruby
Nahra has joined #ruby
clemens3_ is now known as clemens3
Swyper has quit [Remote host closed the connection]
dfucci has quit [Ping timeout: 246 seconds]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
somazero has quit [Quit: Leaving]
TCZ has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
cognemo has quit [Quit: cognemo]
cognemo has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
bsdbandit-01 has joined #ruby
aremaref has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
aremaref has quit [Ping timeout: 260 seconds]
kristian_on_linu has joined #ruby
TCZ has quit [Quit: https://github.com/srgx]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
pwnd_sfw has quit [Quit: Ping timeout (120 seconds)]
pwnd_sfw has joined #ruby
chouhoulis has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ua_ has quit [Ping timeout: 264 seconds]
pwnd_sfw has quit [Ping timeout: 246 seconds]
ua_ has joined #ruby
Nahra has quit [Quit: leaving]
pwnd_sfw has joined #ruby
akem_ has joined #ruby
MadeInLatvia has quit [Ping timeout: 264 seconds]
DTZUZU has joined #ruby
aremaref has joined #ruby
prion has quit [Quit: WeeChat 2.8]
prion has joined #ruby
gdonald has quit [Quit: leaving]
aremaref has quit [Ping timeout: 265 seconds]
cd has joined #ruby
gdonald has joined #ruby
LtHummus has quit [Quit: ZNC 1.8.2 - https://znc.in]
LtHummus has joined #ruby
jeromelanteri has joined #ruby
hiroaki has joined #ruby
orbyt_ has joined #ruby
akem_ has quit [Ping timeout: 264 seconds]
akem has joined #ruby
elcuervo has quit [Read error: Connection reset by peer]
elcuervo has joined #ruby
ur5us has joined #ruby
TCZ has joined #ruby
kristian_on_linu has quit [Remote host closed the connection]
bocephus607 has joined #ruby
arooni_team_b is now known as arooni
panorain has quit [Remote host closed the connection]
SuperLag has quit [Remote host closed the connection]
SuperLag has joined #ruby
Rudd0 has quit [Ping timeout: 240 seconds]
adu has joined #ruby
prion has quit [Ping timeout: 260 seconds]
aremaref has joined #ruby
aremaref has quit [Ping timeout: 260 seconds]
fanta1 has quit [Quit: fanta1]
adu has quit [Quit: adu]
<ian|> haskell has something like [0,8..256] to create a stepped range, does ruby have something similar?
<ian|> that would generate an array of [0,8,16,24...256] in haskell
weaksauce has joined #ruby
<leftylink> &>> 0.step(256, by: 8).to_a
<rubydoc> # => [0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256] (https://carc.in/#/r/a53u)
<leftylink> &>> ((0..256) % 8).to_a # requires ruby 2.6 or something
<rubydoc> # => [0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256] (https://carc.in/#/r/a53v)
<ian|> thanks!
<leftylink> (I was correct about the latter requiring Ruby 2.6, but step by: should be avabile a lot farther back)
adu has joined #ruby
adu has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
phenom_ has joined #ruby
phenom has quit [Ping timeout: 256 seconds]
postmodern has quit [Quit: Leaving]
bocephus607 has quit [Quit: Leaving]
cnsvc has joined #ruby
prion has joined #ruby
Technodrome has joined #ruby
Eiam has quit [Ping timeout: 265 seconds]
NewAlexandriaOrg has joined #ruby
NewAlexandriaOrg has quit [Client Quit]
sparr has quit [Changing host]
sparr has joined #ruby
harlin has quit [Quit: Leaving]
Rudd0 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nofxx has quit [Ping timeout: 260 seconds]
prion has quit [Ping timeout: 256 seconds]
adu has quit [Quit: adu]
TCZ has quit [Quit: Wawel - Czujesz sie dobrze, czynisz dobrze]
aremaref has joined #ruby
aremaref has quit [Ping timeout: 260 seconds]
nofxx has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
<tempate> Can something like https://dpaste.org/dLpr be achieve?
<tempate> achieved*
<leftylink> that's a classic time to use `case ... when`.
<leftylink> &>> case 5; when String; "str"; when Integer; "int"; else "what" end
<rubydoc> # => "int" (https://carc.in/#/r/a53y)
<leftylink> &>> case "hi"; when String; "str"; when Integer; "int"; else "what" end
<rubydoc> # => "str" (https://carc.in/#/r/a53z)
<tempate> Oh
<tempate> You can do it without the is_a?
<tempate> Nice!
naftilos76 has quit [Ping timeout: 260 seconds]
nofxx has quit [Ping timeout: 268 seconds]
nofxx has joined #ruby
aremaref has joined #ruby
<arahael> i think i've found a bug in ruby - where do i look to check? (specifically: it fails to detect my build tools on macos big sur - on m1)
<arahael> leftylink: thanks for your help yesterday though i think i was a bit overly colourful towards the end. (aussie, here.)
lucasb has quit [Quit: Connection closed for inactivity]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<nakilon> arahael did you do the "x-code license accept" thing?
<arahael> nakilon: i did, yes.
<arahael> nakilon: i also confirmed that "git", "clang++", "swift", etc, work on the command line.
<nakilon> because that's unlikely that you've found such bug on macos because it'a hard to break macos even if you want to
<nakilon> what ruby do you use? how did you install it?
TCZ has joined #ruby
oneeggeach has joined #ruby
<arahael> nakilon: i think it's more likely to find such issues when running on m1, it is not yet a common configuration.
<arahael> i used macports to install ruby27
mbrndtgn has quit [Quit: Ping timeout (120 seconds)]
oneeggeach has quit [Client Quit]
<nakilon> ah, it's that ARM thingy?
<leftylink> hmm... I think I was not particularly of much help other than as a rubber duck, but I am glad I was found to be of some use
<arahael> yeah, indeed. M1 cpu.
mbrndtgn has joined #ruby
<leftylink> oh oh wait, I did deduce the stack size, okay, that part I did
<nakilon> I recomment to install rubies with rbenv
camilasan has quit [Remote host closed the connection]
<nakilon> also macos already has ruby preinstalled
<arahael> i wanted a good "system ruby", though. and yeah, there is a loudly deprecated and obsolete ruby already installed.
<arahael> when you start it it says it's deprecated, seems apple is likely to remove it soon i think.
camilasan has joined #ruby
<nakilon> "loudly deprecated" means just that "people are love to say that it's deprecated"
<arahael> i mean it points it out very clearly when starting the interpreter (when in interactive mode)
<nakilon> *do love
<arahael> like python apple isnt updating them, and it looks like it will be removed soon.
<nakilon> the only rubies that are really barely usable now are <2.3 because when you try to install gems it complains about ssl and I'm lazy to figure out how to fix that
<arahael> ah, i remember having that issue on the intel machines, pretty easy to fix that from memory, had to google something though, i was using homebrew then.
<nakilon> that's why macbooks cost this much -- they don't hurry to update to edge version of stuff or their OS will become same unusable as linux and it would be no point in it
<arahael> yeah, apple is prety clear that the ruby i have (which hasnt been updated since at least catalina).
<arahael> is very deprecated and i dont think anything actually depends on it now. it's provided only for some legacy backwards compatibility.
<nakilon> what dose mean "very deprecated"?
<nakilon> anything can depend on it; previously homebrew was using it before they started supplying own ruby
orbyt_ has joined #ruby
<arahael> usually when apple deprecates something it's just an entry in their docs. and in my experience, they do eventually remove them entirely.
<nakilon> they can't remove it from your machine while you are solving the adventofcode
<arahael> heh, yeah, thats true. i actually just wanted to take the opportunity to have a "good reference version" installed :) i do use ruby ar work (but only for rake and fastlane).
<arahael> though i dont use this m1 for work... this is my personal machine.
<arahael> work tooling isnt yet up to date enough for m1 :( (for the main thing: we still use xcode 11 at work)
<nakilon> I used macports only for a week, in 2013
nofxx has quit [Ping timeout: 246 seconds]
<nakilon> I didn't check but you should expect homebrew and rbenv to support M1 as soon as possible
<arahael> they have been having some... pains...
nofxx has joined #ruby
<arahael> i am currently waiting for go and haskell to support m1; go should arrive next year.
aremaref has quit [Ping timeout: 256 seconds]
<arahael> in any case, the actual issue for me seems to be that gems isnt detecting the build tooling. i dont think that would be different between homebrew or macports?
<nakilon> easily
<nakilon> that's the whole point why people switched to homebrew
<nakilon> because it worked when macports didn't )
<arahael> macports seems to be doing ok at the moment for m1, though i suspect that once #7857 is fixed, homebrew will take over in terms of general support. still lots of broken packages in both cases.
<arahael> here's the thing though... i already have ruby installed?
nofxx_ has joined #ruby
nofxx has quit [Ping timeout: 264 seconds]
Technodrome has joined #ruby
ian| has quit [Quit: Exiting]
ErhardtMundt has quit [Remote host closed the connection]
ian| has joined #ruby
<arahael> For reference, this is what I get when I type gcc --version:
<arahael> Apple clang version 12.0.0 (clang-1200.0.32.28)
ErhardtMundt has joined #ruby
<nakilon> how does the error message look that you say might mean that it does not see built tools?
aremaref has joined #ruby
<arahael> Line 28 is what I was looking at.
nowhere_man has joined #ruby
<arahael> The actual error in the mkmf.log seems to be clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk' [-Wmissing-sysroot]
phenom has joined #ruby
<arahael> And that's because it's indeed looking in the wrong place. :( (I'm on 11.1, not 11.0)
aremaref has quit [Ping timeout: 265 seconds]
phenom_ has quit [Ping timeout: 240 seconds]