Index

Show enters and exits. Hide enters and exits.

00:01:46evanbrixen: poke.
00:01:51brixenevan: thoughts on how you want to handle "#/[$@{]/".inspect
00:01:52brixenhaha
00:01:56brixenyes?
00:02:09brixenthe // is not literal in that string
00:02:27brixen"#$" => "\#$" etc
00:02:37brixenthis blows our table transform approach
00:02:47brixenunless we make the table 2d or something
00:03:33brixenI'm working on a table-based matcher/helper for these sort of specs
00:11:52evanhm
00:12:14evanwell, let me ask my question:
00:12:18brixenk
00:12:30evanwhy did we decide to use a primitive failure in vm_const_defined_under?
00:12:35evanwhy not jsut return true or false?
00:12:46brixenhm
00:13:31evanI ask because i'm pretty sure it's the source of a bug
00:13:39evanif it fails, it's trampling on the current exception
00:13:48evani can fix that by saving the exception to the stack and restoring it
00:14:30evanbut it made me wonder why not just return true/false
00:16:10brixenseems like returning true or false would work
00:16:25brixenI can't see a reason for primitive failure reviewing the commits
00:16:56evanyou had a reason, i just don't recall what it was
00:16:59brixenbecause we are not attaching to a method, just calling from the compiler
00:17:36brixenwell, it either returns the const, returns the value from const_missing, or ...
00:18:32evanany non-exception is eaten and a string is left for the user
00:30:27brixenevan: this is what I'm thinking about: http://gist.github.com/392864
00:30:45brixenthis would be useful for #pack, #unpack, and #regexp too
00:30:47evansure
00:31:00brixenI want something inside the it block in case it needs more stuff
00:31:09evanpretty clear that you're saying inspect should transform the left to the right
00:31:16brixenrather than an it_is_computed_xxx like it_behaves_like
00:31:20brixenyeah, exactly
00:31:28brixenI want the side-by-side comparison
00:31:33evanyep.
00:31:36brixenok
00:32:12evanback to my problem:
00:32:36evanwhat is value_defined supposed to leave on the stack?
00:32:54brixenthe value of the expression
00:33:12brixenbut executing the expression may cause an exception
00:33:24brixenwhich is what the handler is for
00:33:34evanthe label passed in is what ya mean
00:33:35evanright?
00:33:38brixenyeah
00:33:47brixenwell, let me look
00:34:05evancrap.
00:34:21evanall of these value_defined usages of setup_unwind are buggy
00:34:27evanthey all trample on the current exception
00:35:03brixenno, the label passed in is generally for the fail case
00:35:15brixenie, returning nil from the defined?()
00:35:38brixenthe handler block is in case executing expr in defined?(expr) raises
00:36:02evanhandler block?
00:36:21brixeneg, constants.rb 53
00:36:37evani've been mucking in there
00:36:37brixenthat setup_unwind is in case finding the const raises
00:36:42brixenone sec..
00:36:52evanwhats the case where it would raise?
00:37:08evanseems to only be because the vm_const_defined_under raises PrimitiveFailure
00:37:13brixenhttp://gist.github.com/392874
00:37:15evanthere is no other exception that could come out of there
00:37:23brixenconst_missing could raise
00:37:55evanooh.
00:38:02evanand you shouldn't expose that raise
00:38:03evanright?
00:38:07brixenright
00:38:14evanyou should just say "nope, not defined"
00:38:17brixenyes
00:38:23brixenreturn nil, essentially
00:38:46evanok
00:38:56evani'll add the code to prevent the trampeling then
00:39:08evankeeping the setup_unwinds
00:39:11brixenI see the problem with this though
00:39:29brixenreturning primitive failure is not == to raising an exception here
00:39:30evanoh?
00:39:39evanit is
00:39:40brixenthis gist is better http://gist.github.com/392874
00:39:43evanbecause invoke_primitive is used.
00:39:43brixenis it?
00:39:47brixenahh yes
00:39:47brixenok
00:39:50evanwhich raises an exception if the primitive fails
00:39:54brixenman, I was really like wtf was I thinking
00:39:56brixenhehe
00:40:01evan:)
00:40:27evanbasically, we have to be careful with exception handlers
00:40:34brixenso, in that gist, if value_defined at line 5 raises, you should end up at 11
00:40:41evanwe've forgot that they can also run in the context of an existing exception
00:40:45evanand need to preserve that.
00:40:46brixenok
00:41:01evansure, i follow the control flow fine.
00:41:13brixenok
00:43:00brixenwell, I'm heading out for a ride, but I'll push this spec stuff later
00:43:17brixennot sure what to do with #inspect yet :/
00:43:32evanso in inspect
00:43:36evan"#" => "#"
00:43:40evanand "#$" => "\#$"
00:43:43brixenyes
00:43:44evanthats the issue, right?
00:43:51brixen#@ and #{ too
00:43:55evansure sure
00:43:56brixenmri uses IS_EVSTR
00:43:57brixenyeh
00:44:19brixenI should look at transform
00:44:25evanand i'm using my table transformer primitive for this, aren't I?
00:44:25brixendaes it do string match or char match?
00:44:28brixenyes
00:44:51brixenif string match, we can just use "#$" => "\#$"
00:45:14evanfeel free to extend it
00:45:27evanit should be easy to add another dimension
00:45:29evanie
00:46:07evantbl[?#] = LookupTable.new("#$" => "\#$")
00:46:20evanprobably don't want to use a Tuple for the new dimension though
00:46:23evanwe'll waste a lot of space
00:46:29brixenthat's what I was thinking too
00:46:44evanor use a key, val Tuple
00:46:45evanie
00:47:03evantbl[?#] = Tuple.from("#$", "\#$", "#{", "\#{")
00:47:08brixenright, if ?# => Tuple then switch
00:47:09brixenyeah
00:47:27evanthats fine
00:47:36evanprobably won't slow down the matcher
00:47:43brixenbut that still precludes precalculating the size of the output
00:47:46evanit will be a simple condition in the replacement code
00:47:59evanwhy?
00:48:13brixenbecause you don't know yet
00:48:29evanwhat precalculation code to dyou mean?
00:48:30brixen#x => #x but #$ => \\#$
00:48:35evanwe already support that
00:48:39evanor rather, it does.
00:48:49evanbecause you can have [?#] = "whatever"
00:49:05evanthe keys are always strings of unknown length
00:49:08evanso it should be the same
00:49:17evanbrb
00:49:17brixenI'll look at it
00:50:56evanback
00:50:57evanok
00:55:21brixenthe tuple approach would work fine, yes
00:55:30brixenI can do that later unless you want to
01:38:27boyscoutKeep the current exception from being trampled on - a3f6a6b - Evan Phoenix
01:48:13boyscoutCI: rubinius: a3f6a6b successful: 3457 files, 13581 examples, 41201 expectations, 0 failures, 0 errors
03:58:29brixen24 mi of fun
03:58:45brixencrazy that it will be 39 F tonight
03:58:59brixenwhat kind of may is this
16:10:59evanmorning.
16:12:29brixenmorning
16:13:32brixenevan: was this what you had in mind? http://gist.github.com/393642
16:14:11evanwell, not exactly
16:14:20brixenseems like we should write into a malloc'd buffer that could be reallocted and finally memcpy'd into a ByteArray
16:14:23evanthat says, to me, that you replace #$ with \#
16:14:29evanwhere did the $ go?
16:14:39brixenit's the next char to be processed
16:15:04brixenbut yeah, you could consume len of the input str and replace it with the value in the map
16:15:19brixenbut that doesn't fundamentally change much
16:15:25brixenI can add that
16:15:47brixenstill seems pretty complex
16:17:10evanbut more powerful
16:17:12evanimho.
16:17:25evanbecause it lets you consume N characters at once in the loop
16:17:33brixenthat's fine
16:17:40brixenI'm more talking about precalculating the size
16:17:47brixenthat seems unnecessarily complex
16:18:02evanah
16:18:09evanwell, how big do you make it then?
16:18:27evanyou wanna realloc space if you run out?
16:18:41brixenstart with an optimistic guess that that output will be 1-1.25 or something
16:18:44brixenthen realloc, yes
16:18:46brixenif needed
16:19:05brixenfinally memcpy into a bytearray
16:19:31brixensince you have to cast every key in the table now
16:19:39brixento make sure it's a String or Tuple
16:19:42brixenthen do it again
16:20:00evansure
16:20:07evani don't have an issue with doing that
16:20:37brixenI could bench it, but generating realistic strings to test is not real easy
16:20:58brixenlike, I don't know how much people are using KCODE=u
16:21:27DefilerI've been setting that as my default for years now
16:21:55Defiler(usually in the actual configure options to MRI, but usually also in rubyopt etc etc)
16:21:57brixengood to know
16:22:19evanbrixen: i think doing 1.25x then reallocing if necessary is fine
16:22:27evandoing the strict calculation was originally pretty easy
16:22:30brixenevan: ok
16:22:38brixenyeah, it's much more complicated now
16:22:43brixenthat's all I meant
16:38:06cremesdoes rbx up to date with ffi support?
16:41:18brixencremes: rbx ffi is not fully compatible with ruby-ffi, no
16:41:39brixencremes: post 1.0 we will address it
16:42:07cremesokay then i won't list it as compatible with my zeromq ffi bindings yet
16:42:40evancremes: did you figure out your memory leak?
16:43:08cremesnope, not yet
16:43:21cremesi was hoping to run it under rbx and see if it gave me any insight
16:46:03evanyou might as well try it.
16:46:06evanunder rbx
16:46:18cremesokay
16:46:19evanseems like you're using the basics of FFI, which rbx supports fine.
16:46:47cremesis there an rbx memory profiler or leak detector?
16:47:22brixencremes: if you have tests for zeromq, you should definitely run it on rbx
16:47:58cremesbrixen: i don't have any tests or specs for it... :(
16:48:05brixenwould leaks(1) work for this on os x?
16:48:13brixencremes: what what wot? :P
16:48:19evansure
16:48:22evanleaks(1) works
16:48:33cremesi usually write perfect code :-\
16:48:40evanFRIDAY ZING!
16:48:44brixencremes: hahah
17:02:34cremesi get an error when trying to install my gem which is dependent on the ffi gem: http://pastie.org/950359
17:02:56cremesdo i need to remove the ffi dependency first? can i make it optional?
17:05:25brixencremes: I don't know what the error is, can you use -V on install
17:05:34evanyou need to remove it.
17:10:08cremesi must be using some new ffi syntax that rbx doesn't like: http://gist.github.com/393723
17:11:23evanhm, no, thats the same.
17:11:27evanshould work fine...
17:13:10evanoh, it's passing an array for ffi_lib
17:13:22evanman, i wish that they hadn't change ruby-ffi so much from my original API
17:14:37evancremes: i guess ruby-ffi supports passing a array there
17:14:43evanyou should be splatting it for compat though
17:14:57evanie, the ffi_lib api was originally: ffi_lib "this", "that", "other thing"
17:21:52rueI think it was just "this" originally originally
17:24:29evanrue: true
17:38:39cremesit still chokes; it looks like it is loading the lib but now i can't find any functions: http://gist.github.com/393723
18:08:46evanBOO
18:08:59evanthe remove_instance_variable spec is basically empty. :/
18:09:04evanand we have a bug in it
18:09:10evanwell, no time like the present!
18:11:11brixenheh
18:11:23brixenman, how is it empty though
18:11:41evanyeah
18:11:41evan:/
18:12:07brixenI guess none of the other impls have ever hit a bug in that method
18:12:18evanguess not
18:12:19brixencus I'm sure they would have contributed some specs for it
18:12:20brixen:/
18:12:23evanwe're returning self
18:12:26evanrather than the deleted value
18:12:42brixenwelp, rubyspec wins again
18:12:59brixenain't nothing like some good tests
19:40:52cremesfound my FFI memory leak; it was *my* fault! Yay!
19:42:16brixensweet
19:53:12cremesstill doesn't need specs or tests...
19:56:29DefilerDoes Time have an API for asking whether a given string is parseable as a Time object?
19:56:40Defileror do you really have to do Time.parse(input) rescue nil ?
19:58:24evanpretty sure thats it.
20:07:59Defilerdef i_know_and_i_am_sorry;end Time.parse(input) rescue i_know_and_i_am_sorry
20:20:09evanTime.☹parse(input) could be equiv to Time.parse(input) rescue nil
23:33:09boyscoutAdd spec for sorting a large array - e6bb6eb - Evan Phoenix
23:33:10boyscoutFlesh out Kernel#remove_instance_variable spec - 5761bb0 - Evan Phoenix
23:33:10boyscoutFix sorting of a large array with a shifted start - 7bb5b3e - Evan Phoenix
23:33:10boyscoutFix Kernel#remove_instance_variable - c3001bb - Evan Phoenix
23:33:10boyscoutFix checking for if protected is allowed - 673aa09 - Evan Phoenix
23:35:44evanonly 2 harmless generator rails 3 tests failing now
23:45:18brixensweet
23:51:00boyscoutCI: Commit 673aa09 failed. http://github.com/evanphx/rubinius/commit/673aa09260403a03a043c75f268818d1f6070fe6