<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.
<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]
<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>
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)