Index

Show enters and exits. Hide enters and exits.

00:00:03evanother name suggestions?
00:00:04wayneeseguinessentially it looks like he's saying use 'rake' not 'rake install'
00:00:12wayneeseguinohai btw :)
00:00:18evanwayneeseguin: he's wrong.
00:00:27wayneeseguinok that's what I thought, wanted to go to the source thought
00:00:31evanrake install does build.
00:00:39wayneeseguinok
00:00:40evanand if you've used --prefix
00:00:44evanyou MUST use rake install to build
00:00:50wayneeseguinyes rvm uses --prefix
00:00:54wayneeseguinok
00:01:16wayneeseguinThank you very much!
00:01:20evanso guys, any thoughts on better names for #fill_locations?
00:01:21evanwayneeseguin: np.
00:03:30evani know you are a creative bunch
00:03:31evancome on!
00:05:23evanbueller
00:05:43evanbeuller...
00:05:56brixenhmm
00:06:42brixenI have no more creative
00:06:52evanit's similar to java's fillInStackTrace
00:07:05brixenI'm just the pulp left from squishing between the cogs of the rubyspec machine
00:07:09evanI guess I could call it fill_backtrace
00:07:25brixenfill_ seems a bit weird to me
00:07:33brixenbut that could be the fatigue talking
00:07:34brixenheh
00:07:46brixenfill_backtrace is pretty descriptive
00:07:55evanok.
00:09:13mahargI find fill strange too, and I only got up 2.5 hours ago. I'd probably call it set_backtrace, but that's not exactly more creative
00:10:02evanit's fill because it doesn't take a backtrace
00:10:11evanthe backtrace is infered from the current call stack
00:10:13evanie
00:10:16mahargah, that makes sense
00:10:17evanexc.fill_backtrace!
00:10:39brixenseems like get_ or create_ might be better
00:10:56evanget_ sounds like it returns something
00:10:59mahargyeah
00:10:59evanit doesn't
00:11:01brixentrue
00:11:03evanit's not creating anything really either.
00:11:18evancapture_backtrace! maybe?
00:11:34evancrystalize_backtrace
00:11:39evanformalize_backtrace
00:11:41brixencapture_ maybe
00:11:47evanstonify_backtrace
00:11:53evan(as in to write in stone)
00:12:08brixenif it were exc.fill_backtrace(obj_to_fill) it might make more sense
00:12:19evanhuh?
00:12:23evanwhats obj_to_fill?
00:12:28brixenexactly
00:12:38evanso to you
00:12:38brixenseems a bit odd to me that fill_ is referring to exc.
00:12:42evanyou think of fill as a verb
00:12:47brixenyes
00:12:47evanwhere the exception isn't the target
00:12:51brixenright
00:12:53evanah
00:13:01evani see it as a verb where the exception IS the target.
00:13:15brixenyeah, probably makes more sense that way
00:13:51brixenI don't think of exc =~ backtrace object
00:13:56brixenmaybe that's the problem
00:14:07brixenexc.backtrace.fill
00:14:16brixennow that makes sense to me
00:14:35evanew. no.
00:14:38brixenbecause exc has_a backtrace not is_a backtrace
00:14:40evanthat can't be the API.
00:14:45brixenwell, just sayin
00:15:26brixenruby *should* have a Backtrace
00:15:31brixenclass
00:15:33evanwell, yes
00:15:41evanbut thats neither here nor there for now.
00:15:50brixenthat's fine
00:16:08brixenI was trying to tease out why fill_backtrace seemed to need an object to operate on
00:16:11brixenin my mind
00:16:58evanok
00:17:00evanwhen you do
00:17:02evanException.new
00:17:07evanthe exception has no backtrace.
00:17:12evanno location information really.
00:17:31evanwhen you raise it, then it gets knowledge of where it was raised from
00:18:16brixenyep
00:18:35evanthus the fill_backtrace!
00:18:48brixenI understand
00:18:54evanok
00:19:07brixenexc.backtrace = Backtrace.new is what I'd expect to see there
00:19:21brixenotherwise, #fill_backtrace is probably AGAIG
00:19:23mahargyeah I was just thinking that
00:19:54evanbut then the the knowledge about how to create a Backtrace is spread out.
00:20:13evanadditionally, i want to put it behind a method that you can override when you inherit
00:20:19evanie, i just did a test where I did
00:20:25evanclass FastError < RuntimeError;
00:20:31evandef fill_backtrace!; end;
00:20:32evanend
00:20:37evanfe = FastError.new
00:20:41evanlooping { raise fe }
00:20:47brixensure
00:20:49evanit's about 2.5x faster than normal
00:20:58evanbecause it doesn't have to capture/fill the backtrace
00:23:18evanbinary42: have you seen Rubinius::Fiber yet?
00:23:36binary42evan: Aha! No but I will check it out tonight!
00:23:48evanbinary42: it's still experimental
00:23:58evanbut it doesn't do any stack copying.
00:24:17binary42evan: Awesome. I will definitely let you know.
00:24:29binary42is used to "experimental" software.
00:25:01evangeez, the place where MRI actually fills the exception with the backtrace is buried
00:25:10evanit's in the middle of rb_longjmp()
00:25:58binary42needs to sign out. bbl.
00:26:07evanlater.
00:31:10evanok, i think i'm going with capture_backtrace!
00:33:28brixencool
00:33:49evanha
00:33:53evanironically it's not actually faster
00:33:57evani screwed up the benchmark
00:33:58evanoh well.
00:56:19tarcieriso uhh yeah your response from earlier is decidedly noncomittal, should I be pointing people who want to embed a Ruby interpreter into their C(++) programs to Rubinius like "omg comparatively easy to embed vs MRI"?
00:56:52evanyeah
00:56:53evanplease do.
00:57:02tarcieriseems to recall easy embed being one of Rubinius's early talking points
00:57:22mahargI would suggest to have them look at vm/drivers/cli.cpp and if they can understand that, they're probably good
00:57:29tarciericool
00:57:30evanit's still easy.
00:57:51evanif they find it hard/broken
00:57:54evani'm open to fixing it!
00:58:05evanwe don't yet link as a shared library
00:58:11evanso that makes it a little harder to embed.
00:58:34tarcieriheh, yeah sounds like what this one guy is trying to do
00:58:45tarcieriI'm just kinda blown away by the other guy's comments
00:58:59tarcieri"I looked at embedding Lua in my C program... it sounded hard so I decided to try embedding RUBY!"
00:59:08maharghah
00:59:11evanhahah
01:00:15mahargnot to denigrate rubinius in any way (since it hasn't been the focus), but the smoothest embed api I know of for a scripting language is TCL's.
01:00:29mahargI understand lua's is pretty good, but the language seems so barren
01:00:36evanI recall TCLs being good too
01:00:43evanthey put about 10 years of work into making it good.
01:00:52evancourse, no one writes much TCL anymore.
01:01:15mahargI still <3 tcl a bit. Turtles all the way down, but with strings
01:01:27brixencan someone remind me why we have IO.open f.fileno again, please?
01:01:34evanbrixen: no one knows.
01:01:37evanno seriously.
01:01:39brixenfuck
01:01:41brixenf u c k
01:01:46evanafter I debugged it last time
01:01:46brixenseriously
01:01:47evani asked
01:01:58brixenok
01:02:08evanthere is some explanation about needing it because Socket.socket_pair returns 2 fds
01:02:11evanas Fixnums
01:02:17evanand you need to be able to pass those to IO.open
01:02:29evan"why doesn't socket_pair return 2 IOs?" is the next question
01:02:34evanto which I have no answer.
01:02:35brixenindeed
01:02:37brixenok
01:03:03brixensome creative soul decided to write specs that use IO.new f.lineno, where f is some File.new
01:03:11brixenbut you cannot close both those
01:03:21brixenso, it's just insanity
01:03:47evanOH
01:03:50evanthose are the ones
01:03:58evanTHE ones that I hit the bug before.
01:04:43evanthat started me down the rabbit hole of going "UM. FUCK. This feature destabilizes the entire IO system."
01:04:50brixenyeah
01:04:55brixenso crazy
01:05:28evani wonder if we shouldn't go ahead and leak fds in that case
01:05:33evanie, you use IO.open
01:05:37evanand DON'T use #close
01:05:44evanfuck you.
01:05:48evanleak fds.
01:06:09evanthat at least fixes the worst part of the destabilization
01:06:15brixenyeah
01:06:22mahargbeing able to manipulate fd numbers is kind of necessary for some things. Like fastcgi, for example. Not sure if that part in particular is used, but you need to be able to create an IO object on, say, fd 3 or whatever so the parent process can communicate.
01:06:40evanyeah
01:06:42evanthats the issue
01:06:49evanpeople have been able to use IO.open(fd)
01:06:50evanso they have.
01:06:59evanand now there are some crazy bugs in the wild.
01:07:42brixenIO.new on stdout, stdin, stderr is one thing
01:07:49brixenand you'd never leak those fds anyway
01:08:20evanright
01:08:32evanwe can solve this with a level of indirection
01:08:34evanif we have to.
01:08:51evanIO's never get to hold a true fd
01:08:57evanthey hold a handle to an fd table
01:09:15evanand the table uses ref counts to know how many IO objects are using an fd
01:09:44evanthat also solves the issue, because we won't close an fd that has users.
01:09:55evanhm, actually...
01:09:55brixenI wish IO could have the fd only, and File, Socket, etc could never
01:10:02brixenthey could only reference an IO
01:10:24brixenand every IO.new(fd) dup'd
01:10:31evanyeah
01:10:35evanthe dup is so key.
01:10:46evanbut it leaks fds too
01:10:53evanbeacuse of crap like Socket.pair
01:10:59evanwhich return bare fds
01:11:05brixenwell, in the case it does, I think the arch is broken
01:11:12brixenI dunno
01:11:16brixenit's such a mess
01:11:21evanagreed.
01:12:57brixenI'm just not going ot permit '@file.close unless @file.closed? rescue Errno::EBADF' in the specs
01:13:04evanfine
01:13:06evantotally fine
01:13:09evani was about to say that
01:13:16evanthose are entirely undefined behaviors.
01:13:22brixenif File < IO and there's no sensible way to get an IO otherwise, then fuck it
01:13:24evanjruby doesn't have the problem
01:13:27brixentest IO with a File
01:13:34evanbecause they use an indirection table
01:13:49evanin fact
01:14:00evani'd say that almost anything that tests for EBADF should be removed
01:14:13evanEBADF is, pretty much definition, an undefined behavior/bug
01:14:29evanby definition, rather.
01:14:33brixenyeah
01:14:57evanso, i thought of a way to "fix" this for rubinius.
01:15:12evanall IO objects have a finalizer
01:15:16evanto call close()
01:15:24evanwhich is where the actual destabilization happens.
01:15:35evanactually, no, thats not true.
01:15:39evanIO#close can destablize too.
01:15:40evannm.
01:16:55evanrad
01:17:00evanok, i've got backtrace fixed up ab it
01:17:20evanusing Exception#set_backtrace() is much more sane about what data it changes
01:17:29brixencool
01:17:35evancheck it
01:18:26evanhttp://gist.github.com/298802
01:18:55brixensweet!
01:19:07evanloosing the REAL backtrace for the Exception is dumb
01:19:11evani might as well just show both.
01:19:46evanso, to mitigate this:http://gist.github.com/298803
01:20:33evanthe MRI compatible backtrace (Array of Strings) has hidden within it an ivar that points back to the Backtrace object it was for
01:20:39evanand raise will try and extract that back out
01:21:13evanhm, I need to probably verify it's not been changed
01:29:59evanok, there
01:30:02evanworks pretty well now.
01:31:42brixenevan: opinion on specs such as this http://gist.github.com/298812 ?
01:32:24evani'm against warning only specs
01:32:33evanbecause warns mean nothing to the functionality.
01:32:34brixenmoi aussi
01:32:38brixenyep
01:32:59brixenthat's been my position since the beginning
01:34:12boyscoutCleanup backtraces, add Exception#capture_backtrace! - 274fd73 - Evan Phoenix
01:34:14evanok, i'm going to head up to office depot briefly.
01:34:15evanbbiab.
01:34:19brixenk
01:38:33boyscoutCI: rubinius: 274fd73 successful: 3041 files, 11850 examples, 36139 expectations, 0 failures, 0 errors
01:39:22jvoorhisare any gui libs running on rbx yet?
01:43:08brixenjvoorhis: not that I know of
01:43:16brixensomeone was asking about fxruby recently
01:44:28jvoorhiscool, just wondered what the climate was like
01:45:20brixenfoggy
01:45:28brixenterrain undetermined :)
01:46:49jvoorhisneeds more ffi
01:48:00brixen"but wait, there's more. compile now and you can use ffi to water your garden, write gui apps, send messags to your mother, all for only 19.99"
01:49:19jvoorhisha
01:49:58jvoorhisor use ruby for realtime projects :)
01:51:03brixenthat's a bonus, but it will cost you extra S&H
01:53:24brixenI don't think I can take one more IO spec today without vomiting all over myself
01:53:28brixenle sigh