Show enters and exits. Hide enters and exits.
| 00:04:54 | brixen | you know, why do we go to all this trouble to make Ruby wonderful? |
| 00:05:00 | brixen | effen lazy_array |
| 00:05:06 | brixen | guess what it does.... |
| 00:05:17 | brixen | it defines method_missing, for one |
| 00:05:30 | brixen | and guess where __class__ and #copy_object end up? |
| 00:05:34 | brixen | just guess... |
| 00:05:44 | brixen | and guess what #copy_object does in rbx |
| 00:05:49 | evan | ug. |
| 00:05:49 | evan | yeah |
| 00:05:52 | evan | i recall hitting that |
| 00:05:53 | brixen | seriously, just a wild guess |
| 00:05:55 | evan | and not fixing it. |
| 00:06:06 | evan | lazy_array redefines __class__ ? |
| 00:06:10 | evan | thats bad news. |
| 00:06:11 | evan | mega |
| 00:06:25 | evan | it shouldn't touch any __ methods. |
| 00:07:34 | brixen | http://gist.github.com/230474 |
| 00:07:46 | brixen | so, of course our copy object prim will fail with a type error |
| 00:07:52 | evan | yeah |
| 00:07:55 | brixen | you tried to copy and Object into an Array |
| 00:07:56 | evan | we've had that happen before |
| 00:08:04 | evan | copy_object is thankfully doing the right thing by failing loudly |
| 00:08:14 | brixen | yes |
| 00:08:27 | evan | that kind of code is exactly why we can't have nice things |
| 00:08:29 | brixen | unfortunately it cannot also nuke LazyArray |
| 00:08:32 | brixen | ... from orbit! |
| 00:08:42 | evan | readys the orbital weapons platform |
| 00:08:48 | brixen | go! |
| 00:09:09 | evan | launches the nukes. |
| 00:10:00 | brixen | at this point, I think a full RubyConf talk should be dedicated to educating and instructing people on what it means to have a *real* Ruby implementation |
| 00:10:14 | evan | yeah |
| 00:10:20 | brixen | "don't act like you're the only person in the room" |
| 00:10:25 | brixen | YOU'RE NOT |
| 00:13:14 | ddub | silly question perhaps, but does Object#hash use the memory address as the basis of the hash key? |
| 00:13:26 | evan | no |
| 00:15:03 | ddub | oh interesting |
| 00:15:50 | ddub | (I was misreading code before and asking to double-check, as using the memory address would be unfortunate in conjunction with a relocating GC) |
| 00:16:33 | evan | yeah |
| 00:16:39 | evan | pretty much not possible. |
| 00:18:53 | evan | GAH |
| 00:19:08 | ddub | GAH! |
| 00:19:09 | evan | IO#reopen(other_io) raise an exception if the reciever is closed |
| 00:19:11 | evan | but |
| 00:19:16 | evan | IO#reopen(path, mode) does not. |
| 00:22:24 | brixen | well that's... |
| 00:22:30 | brixen | ok, I'm without words |
| 00:22:39 | brixen | 4:22! |
| 00:22:41 | brixen | dammit |
| 00:22:43 | brixen | late again |
| 00:22:51 | brixen | and too many wtf's today |
| 00:23:10 | evan | there is always tomorrow. |
| 00:23:19 | brixen | heh |
| 00:23:25 | brixen | the day is young! |
| 00:24:27 | slava | sup boys |
| 00:26:01 | slava | ddub: what you can do is use the address as the hash until the object is relocated, and after it is relocated, add a new ivar to the object with the old address and use that as the hash |
| 00:31:38 | evan | slava: surely you're joking. |
| 00:31:56 | slava | no, its a legitimate technique |
| 00:32:08 | slava | it saves one word per object unless you actually take its identity hashcode (which is rare) |
| 00:32:38 | slava | I'm not telling ddub to implement this, just answering his question about using the address as a hash -vs- compacting GC |
| 00:32:42 | evan | so you fixup all objects |
| 00:32:59 | slava | no, only those that have had their id hash already taken |
| 00:33:02 | evan | that can't work if something (a hash table) saves the hash value |
| 00:33:05 | evan | you can't fix that up. |
| 00:33:24 | slava | the hash doesn't change |
| 00:33:24 | evan | because you can't identify the hash value in the heap |
| 00:33:27 | evan | it's just a random number. |
| 00:33:35 | slava | when you promote the object, you store its old address in the hash field in the header |
| 00:33:35 | evan | i thought you're saying you change it everytime |
| 00:33:37 | slava | no |
| 00:33:51 | slava | although some GCs do use the current address as the hash, and rehash identity hashtables on every GC, but that's a different technique |
| 00:35:27 | slava | this is easy too -- when yo udo a GC, you set a flag in the hashtable's header and check the flag on every access; if it is set you rehash |
| 00:35:29 | ddub | obviously |
| 00:35:36 | ddub | you should just make the default hash return 0 |
| 00:37:21 | ddub | thinks he is quite clever |
| 00:37:45 | evan | sweet |
| 00:37:49 | evan | got argf basically rewritten |
| 00:37:54 | slava | evan: I haven't even added identity hashing yet but when I do I'm going to use unused space in the header (only 4 bits are occupied) |
| 00:38:00 | evan | and it now passes all the specs but the inplace edit ones. |
| 00:38:35 | evan | right |
| 00:38:50 | evan | i'm considering shifting a few things around to get at least 16 bits free |
| 00:38:56 | evan | and putting a hash code in there |
| 00:39:02 | slava | what's in your header? |
| 00:39:15 | evan | so that blah.hash doesn't require an object_id to be setup |
| 00:39:20 | slava | mine just stores the built-in type number, and if the type is a tuple then a second header field stores a class pointer |
| 00:39:56 | evan | type number, mark bits, gc zone number |
| 00:40:01 | evan | and a couple other flags |
| 00:40:07 | slava | can't you determine the gc zone from the address? |
| 00:40:15 | slava | and store mark bits in a bitmap off to the side? |
| 00:40:23 | evan | i can, but it's nice to have it right there in the header |
| 00:40:26 | evan | it's a great sanity check. |
| 00:40:54 | evan | there are 2 mark bits, i could store them off to the side |
| 00:40:59 | evan | i'm considering that. |
| 00:41:04 | slava | why 2? something to do with weak pointers? |
| 00:41:11 | evan | nah. |
| 00:41:21 | evan | it was originally a debugging mechanism |
| 00:41:34 | evan | to detect objects that missed one mark/sweep |
| 00:41:38 | evan | but were caught in the next one |
| 00:41:51 | evan | but i'm going to reuse it now to eliminate the unmarking phase entirely |
| 00:42:10 | evan | by flip-floping the mark number between collections |
| 00:42:20 | slava | oh I see |
| 00:42:27 | slava | otherwise you'd have to clear the mark bits after a GC |
| 00:42:45 | evan | yep |
| 00:43:30 | slava | I guess a mark bitmap only makes sense with a contiguous heap |
| 00:44:38 | evan | ype |
| 00:44:48 | slava | or a block structured heap |
| 01:27:32 | evan | what |
| 01:27:32 | evan | the |
| 01:27:34 | evan | fuck |
| 01:27:37 | evan | suddenly now |
| 01:27:46 | evan | the CI specs are forking bombing |
| 02:17:53 | evan | ARG |
| 02:17:59 | evan | there is an ARGF spec that closes STDIN |
| 02:18:07 | evan | and thusly breaks a bunch of other stuff |
| 02:25:59 | evan | brixen: you still around? |
| 02:28:21 | brixen | yep |
| 02:28:22 | brixen | sup? |
| 02:28:33 | evan | i'm going to quaratine a spec |
| 02:28:36 | brixen | k |
| 02:28:50 | evan | specificly, the one that tests that ARGF, when taking -, closes STDIN |
| 02:28:55 | brixen | be sure to add ! so it knows you mean it :) |
| 02:29:09 | evan | running that now that ARGF is actually doing what it should means that it actually closes STDIN |
| 02:29:17 | evan | and that easily destabalizes the rest of the spec run |
| 02:29:23 | evan | specificly, it destabalizes IO.popen |
| 02:29:28 | brixen | yeah, it's a wacky behavior |
| 02:29:33 | brixen | I mean, seriously |
| 02:29:35 | evan | because it uses STDIN.reopen to rotate IOs |
| 02:29:50 | evan | and you can't use IO#reopen(other_io) on a closed stream |
| 02:30:05 | brixen | you can add not_compliant_on :rubinius too |
| 02:30:08 | evan | ok, well, it took all day |
| 02:30:13 | brixen | :( |
| 02:30:16 | evan | but ARGF is 99% complaint. |
| 02:30:22 | brixen | ahh sweet! |
| 02:30:29 | evan | only thing missing is the in-place operations. |
| 02:30:50 | brixen | awesome |
| 02:30:54 | evan | caught a comple of other bugs |
| 02:31:01 | evan | mainly because ARGF is built some much on IO |
| 02:31:11 | evan | and the specs do some twisty IO things |
| 02:32:24 | brixen | I do wish we could get Amy and Seth to do a Seriously? Ruby edition |
| 02:32:24 | evan | the ARGF specs are wierd |
| 02:32:27 | evan | mainly because ARGF is wierd |
| 02:32:32 | brixen | yeah |
| 02:32:35 | evan | like there is a spec that reopens the thing it just closed |
| 02:32:39 | evan | no comment or anything |
| 02:32:43 | brixen | heh |
| 02:32:45 | evan | i deleted the line |
| 02:32:49 | evan | and most of the ARGF specs broke. |
| 02:33:03 | evan | so it's cleanup code basically |
| 02:33:09 | evan | because you can't isolate ARGF |
| 02:33:18 | evan | in rbx we can, but not MRI. |
| 02:33:29 | boyscout | Add 2 missing IO#reopen specs - 2785899 - Evan Phoenix |
| 02:33:29 | boyscout | Have mspec print out a backtrace when it's interrupt in debug - d79a685 - Evan Phoenix |
| 02:33:29 | boyscout | Fix IO#reopen(path, mode) for closed streams - 80978c8 - Evan Phoenix |
| 02:33:29 | boyscout | Rework ARGF entirely - 0dc2945 - Evan Phoenix |
| 02:33:29 | boyscout | Update tags for ARGF - 4161576 - Evan Phoenix |
| 02:33:29 | boyscout | Quarantine bad ARGF spec - 973ceb1 - Evan Phoenix |
| 02:33:31 | boyscout | Add extra checks for using ARGF is stdin only mode - 17983f3 - Evan Phoenix |
| 02:33:33 | boyscout | Move the flush/closed checks around in IO#reopen - d05de3d - Evan Phoenix |
| 02:33:57 | evan | maybe i'll get past a tomorrow! |
| 02:34:05 | brixen | hah |
| 02:35:21 | boyscout | CI: d05de3d success. 3002 files, 11363 examples, 35372 expectations, 0 failures, 0 errors |
| 02:36:38 | brixen | ok, I see the spec |
| 02:36:50 | brixen | we should be able to run that using ruby_exe |
| 02:36:52 | brixen | I'll look at it |
| 03:34:07 | benschwarz | evan: |
| 15:04:51 | ddub | good morning |
| 15:31:04 | rue | Morning |
| 15:50:17 | rue | Was there a decision on the kernel special forms/double-underscore matter? |
| 16:08:30 | darix | is the rake install step already there? |
| 16:44:39 | helozjisky | hi all, i got a error while building melbourne for MRI, any idea ? |
| 16:48:24 | helozjisky | i forgot ruby-dev |
| 16:58:25 | evan | rue: what was the question? |
| 17:04:38 | brixen | helozjisky: can you give me a gist of your error? |
| 17:05:50 | brixen | evan: http://github.com/jvoorhis/ruby-llvm/blob/master/samples/factorial.rb |
| 17:06:17 | brixen | I used to work with jeremy |
| 17:06:18 | evan | huh. |
| 17:06:23 | evan | cool. |
| 17:06:30 | brixen | I talked to him last night about getting it running in rbx |
| 17:06:39 | brixen | I think he uses AutoPointer |
| 17:06:52 | brixen | but I'm sure he'd be ok with doing it a better way |
| 17:07:10 | brixen | anyway, yeah cool |
| 17:07:23 | evan | is it using FFI? |
| 17:07:24 | brixen | since I wanted to write ffi bindings to llvm but he beat me to it! :) |
| 17:07:26 | brixen | yep |
| 17:07:28 | evan | cool! |
| 17:07:31 | brixen | yeah! |
| 17:07:34 | helozjisky | brixen: just missed ruby-dev |
| 17:07:38 | evan | yeah, poor AutoPointer |
| 17:07:43 | evan | finalizers ftl. |
| 17:07:51 | brixen | helozjisky: I don't know what ruby-dev is |
| 17:07:56 | brixen | evan: yep |
| 17:08:13 | brixen | evan: extension compiler coming along very nicely |
| 17:08:22 | brixen | just a few rake rules and some helper methods |
| 17:08:23 | evan | awesome |
| 17:08:53 | brixen | I'll test it directly on elle before I push :) |
| 17:09:58 | helozjisky | brixen: an ubuntu package, sudo apt-get install ruby-dev |
| 17:10:14 | brixen | helozjisky: ahh ok |
| 17:10:57 | evan | yes, i forgot that package on my new ubuntu VM too |
| 17:11:00 | evan | originally |
| 17:12:18 | evan | i'm reading the thesis about implementing a GHC backend in LLVM |
| 17:12:33 | helozjisky | you need getting_started.txt on a new system |
| 17:12:43 | brixen | evan: neat |
| 17:12:44 | brixen | link? |
| 17:12:55 | evan | http://www.cse.unsw.edu.au/~pls/thesis/davidt-thesis.pdf |
| 17:13:54 | brixen | cool |
| 17:14:07 | brixen | hot off the presses |
| 17:14:25 | ddub | this worries me |
| 17:14:34 | ddub | now I fear llvm might become Parrot |
| 17:14:55 | brixen | not much chance of that |
| 17:15:01 | brixen | llvm is used for real projects |
| 17:15:08 | brixen | zing |
| 17:17:09 | evan | chris has a pretty good technique for guiding |
| 17:17:15 | evan | basically, he's got the ability to say "no." |
| 17:17:25 | evan | which is not a quality it seems the parrot devs have |
| 17:20:47 | ddub | yeah, that is somewhat essential |
| 17:21:02 | ddub | kinda like how linus has the ability to say "no, and you are an imbecile" |
| 17:21:58 | evan | yeah, i'm not sure the second part of that is necessary |
| 17:22:16 | evan | but then again, linux deals with a much bigger crowd than either chris or I |
| 17:22:39 | evan | something I think thats amazing is that linux hasn't been forked really |
| 17:23:20 | brixen | well, it's not exactly a trivial project |
| 17:23:27 | brixen | the US hasn't been forked either |
| 17:26:02 | evan | hah |
| 17:26:06 | evan | well, there was one time |
| 17:26:13 | evan | but the fork was forcibly merged back in. |
| 17:26:17 | brixen | heh |
| 17:26:18 | brixen | yeah |
| 17:49:51 | boyscout | Fix Kernel#methods for immediate values - 93f67c0 - Evan Phoenix |
| 17:51:42 | boyscout | CI: 93f67c0 success. 3002 files, 11363 examples, 35372 expectations, 0 failures, 0 errors |
| 18:25:05 | ddub | this week kinda snuck up on me, I don't think I'm going to have time to finish the mini-project I wanted to before rc |
| 18:43:07 | boyscout | Add Rubinius::Unsafe.set_class, use with caution! - 7b2902b - Evan Phoenix |
| 18:43:07 | boyscout | Add Peter Bevin's class-becomes-frozen patch - 3a1b04b - Evan Phoenix |
| 18:43:07 | boyscout | Update Array tags - 017242f - Evan Phoenix |
| 18:44:17 | brixen | badaboom |
| 18:45:44 | evan | pretty painless |
| 18:45:54 | evan | Unsafe.set_class has a few restrictions |
| 18:46:34 | brixen | 1. get a note from your mother, 2. ... |
| 18:50:43 | boyscout | CI: 017242f success. 3002 files, 11389 examples, 35400 expectations, 0 failures, 0 errors |
| 18:51:02 | evan | pretty much. |
| 18:51:12 | evan | the restrictions are mainly type safety |
| 18:51:18 | evan | so that you can't create an invalid object |
| 18:51:29 | evan | ie, an object layout that is a mismatch to the class |
| 18:51:53 | brixen | makes perfect sense |
| 18:52:19 | evan | brixen: could you check out array/hash_spec.rb:25 |
| 18:52:34 | brixen | yeah |
| 18:52:48 | evan | i always forget how a ruby_bug works |
| 18:52:52 | evan | thats saying what? |
| 18:53:00 | evan | because that behavior isn't true on 1.8.7 |
| 18:53:09 | evan | a recursive array on 1.8.7 has a different hash value |
| 18:53:10 | brixen | it's a bug in less than 1.9.1 |
| 18:53:12 | brixen | yeah |
| 18:53:28 | brixen | that's a bunch of work marcandre did and I think it's all in 1.9 |
| 18:53:29 | evan | ruby_bug is only conditional on MRI though |
| 18:53:30 | evan | right |
| 18:53:33 | brixen | right |
| 18:53:38 | evan | k |
| 18:53:51 | evan | so idealy we wouldn't have the same bug |
| 18:53:52 | brixen | you can put a ruby_version_is "1.9" around it |
| 18:53:59 | brixen | ideally we would not |
| 18:54:02 | brixen | in any version |
| 18:54:05 | evan | ok |
| 18:54:08 | evan | i'll poke at this |
| 18:54:11 | brixen | k |
| 18:54:12 | evan | see if i can implement it easily. |
| 18:55:14 | evan | hm, 1.9.1p129 still has this bug |
| 18:55:53 | brixen | it's probably fixed in 1.9.2 or trunk |
| 19:01:50 | evan | marcandr_: poke? |
| 19:02:04 | evan | <= confused |
| 19:02:43 | evan | ohh |
| 19:02:48 | evan | thats... WIERD. |
| 19:03:50 | evan | no wait. |
| 19:03:54 | evan | this doesn't make sense. |
| 19:04:07 | brixen | wassup? |
| 19:04:30 | evan | i don't see how the code in 1.9 would result in a consistent hash value for a recursive array |
| 19:04:37 | evan | it uses the size |
| 19:04:58 | evan | oh |
| 19:05:01 | evan | i guess i see |
| 19:05:06 | evan | but it's a silly edge case. |
| 19:05:11 | evan | it's only true for |
| 19:05:12 | evan | a = [] |
| 19:05:13 | evan | a << a |
| 19:05:28 | evan | any single recursion will yield the same hash value |
| 19:05:41 | evan | because the depth is 1 |
| 19:05:51 | brixen | ahh yeah |
| 19:07:18 | evan | mm, i think i see. |
| 19:07:25 | evan | i'm using xor to mix the hash value of elements in |
| 19:07:33 | evan | but i'm getting 1 ^ 1 |
| 19:07:52 | evan | in one case, then 1 ^ 0 |
| 19:07:53 | evan | so |
| 19:07:56 | evan | a = [] |
| 19:07:57 | evan | a << a |
| 19:08:03 | evan | a.hash # => 0 |
| 19:08:05 | evan | but then |
| 19:08:08 | evan | [a].hash # => 1 |
| 19:08:12 | evan | this test is silly. |
| 19:08:15 | evan | silly silly silly. |
| 19:08:30 | evan | why the heck is it using a NON recursive array to test? |
| 19:08:51 | evan | thats a side effect of whatever you use to mix the hash values |
| 19:08:56 | evan | i think this is just a bad spec. |
| 19:10:20 | brixen | hmm, why would [rec].hash == rec.hash ? |
| 19:10:26 | evan | it wouldn't. |
| 19:10:34 | brixen | that doesn't make sense to me either |
| 19:10:36 | evan | it's a coincindence that it is in 1.9 |
| 19:10:41 | evan | i'm changing the spec |
| 19:10:41 | brixen | eww |
| 19:10:52 | evan | to actually test what it says it's testing |
| 19:11:06 | evan | and not adding in unrelated (and wrong) bits |
| 19:29:41 | marcandre | evan: hi! |
| 19:36:47 | marcandre | evan: I'm not sure I see what's wrong with the spec of Array#hash, expect maybe replacing specifying that the hash need be the same for _equal_ recursive arrays |
| 19:48:12 | marcandre | evan: let me know if you'd like me to help with the implementation in Rubinius |
| 20:06:52 | ddub | hash on recursive arrays, fun |
| 20:08:10 | marcandre | ddub: it was, actually :-) |
| 20:35:05 | dbussink | brixen: been reworking lazy array a bit and it's also passing all specs now :) |
| 20:35:17 | dbussink | evan: i did find a weirdness with the new frozen stuff btw |
| 20:38:35 | brixen | dbussink: cool |
| 20:38:50 | brixen | dbussink: but do you see why the approach is so brittle and basically bad? |
| 20:39:16 | brixen | also, I've got a compiler fix so transforms don't choke an a.+(*b) |
| 20:39:24 | brixen | I'll push after lunch |
| 20:39:27 | dbussink | brixen: i definitely do yeah, i have the excuse though i didn't write it ;) |
| 20:39:36 | brixen | dbussink: totally understood |
| 20:39:42 | dbussink | brixen: actually most nasty is the undeffing part |
| 20:39:58 | brixen | I think that the attempt to proxy in this case is a complete design fail |
| 20:40:12 | brixen | clients of the lib should NOT expect an Array |
| 20:40:23 | brixen | they should be working with a real lazy DT |
| 20:40:45 | brixen | anyway, I'm freakin' starving |
| 20:40:51 | dbussink | brixen: well, the abstraction of having the lazyness abtracted away works really well actually |
| 20:40:57 | brixen | lunch, bbiab... |
| 21:13:01 | dbussink | evan: you there? |
| 21:13:39 | evan | yep |
| 21:14:44 | dbussink | evan: looks like frozen is not correct yet, since optparse is failing for me |
| 21:15:21 | dbussink | evan: i'll get you a backtrace |
| 21:15:43 | evan | k |
| 21:15:48 | evan | open an issue |
| 21:16:13 | dbussink | other than that i've cleaned up extlib ;) |
| 21:16:26 | dbussink | evan: were you able to reproduce the segfault with ri and rdoc enabled btw? |
| 21:16:29 | benschwarz | whatup ephoenix |
| 21:16:35 | evan | haven't tried again |
| 21:16:37 | evan | benschwarz: hey! |
| 21:16:40 | evan | nice mustache |
| 21:16:45 | benschwarz | saw your video too |
| 21:16:45 | benschwarz | \ |
| 21:16:48 | benschwarz | thanks :) |
| 21:16:53 | evan | which video? |
| 21:17:05 | benschwarz | the rbx, japan one |
| 21:17:11 | benschwarz | can't remember the name of the conf this second :P |
| 21:20:40 | evan | ah yes |
| 21:20:41 | evan | rubyworld. |
| 21:22:45 | marcandre | evan: did you figure out the recursive array specs? Or am I missing something? |
| 21:23:15 | brixen | 312 people have clicked through the link I posted on @rubinius for your talk evan |
| 21:23:36 | evan | marcandre: i've changed them to actually test what they say they test |
| 21:23:59 | evan | brixen: sweet |
| 21:24:27 | marcandre | evan: have you pushed the changes? |
| 21:24:31 | evan | not yet |
| 21:24:33 | evan | will shortly |
| 21:25:06 | marcandre | k. let me know, I'm curious as to what you've changed. |
| 21:25:33 | evan | k |
| 21:34:24 | evan | marcandre: I just pushed the change |
| 21:34:26 | evan | check it out. |
| 21:34:31 | evan | to rbx |
| 21:34:38 | boyscout | Fix recursive Array#hash specs - 1bc7345 - Evan Phoenix |
| 21:34:38 | boyscout | Update Array#hash tags - 8c295a8 - Evan Phoenix |
| 21:36:28 | marcandre | mmmm |
| 21:36:28 | boyscout | CI: 8c295a8 success. 3002 files, 11391 examples, 35402 expectations, 0 failures, 0 errors |
| 21:36:49 | slava | hi evan |
| 21:37:38 | marcandre | evan: those changes are not valid. |
| 21:37:50 | evan | then the spec is worded wrong |
| 21:38:05 | evan | because putting it inside another array isn't testing what the spec says |
| 21:38:15 | evan | and that behavior is not related |
| 21:38:30 | marcandre | I changed the wording after reading your conversation... |
| 21:38:53 | marcandre | The point of the specs is this: since rec == [rec] == [[rec]], they should have the same hash |
| 21:39:11 | marcandre | I'm talking about the original rec, i.e. rec = []; rec << rec |
| 21:39:12 | evan | thats got nothing to do with recursive hash values |
| 21:39:25 | evan | and I don't believe that is a requirement |
| 21:39:35 | evan | why must rec.hash == [rec].hash |
| 21:39:35 | evan | ? |
| 21:39:35 | brixen | marcandre: how is a = []; a << a the same as [a] ? |
| 21:40:28 | marcandre | It's a long thread... |
| 21:40:42 | evan | i think that "rec.hash == [rec].hash" is a red herring |
| 21:40:43 | marcandre | Basically: what is the difference between rec and rec[0] and [rec] |
| 21:40:53 | evan | it's a coincidence that they're equal on 1.9 |
| 21:41:00 | evan | there is no requirement that they are |
| 21:41:10 | marcandre | evan: It's definitely not a coincidence :-) |
| 21:41:15 | evan | sure it is |
| 21:41:18 | evan | i went through the 1.9 code |
| 21:41:24 | evan | it's definitely a coincidence. |
| 21:41:28 | marcandre | good. i _wrote_ the 1.9 code! |
| 21:41:40 | slava | why don't the 1.9 devs just give up and admit defeat? |
| 21:41:43 | slava | their impl sucks |
| 21:41:50 | evan | maybe you didn't intent for it to be, but I read it to be a coincidence |
| 21:42:01 | evan | slava: please, we're having a discussion, if you don't have anything productive, save it for later. |
| 21:42:28 | slava | sorry evan |
| 21:42:45 | brixen | marcandre: http://gist.github.com/231292 |
| 21:42:47 | evan | marcandre: i'm happy to read anything about why "rec.hash == [rec].hash" |
| 21:42:49 | brixen | marcandre: can you explain? |
| 21:42:53 | evan | but i don't understand why it's related at all. |
| 21:43:04 | evan | thats like saying |
| 21:43:10 | evan | "[].hash == [[]].hash" |
| 21:43:20 | marcandre | not at all. |
| 21:43:24 | evan | why not? |
| 21:43:26 | evan | thats what it is. |
| 21:43:30 | evan | it's a hash inside a hash |
| 21:43:31 | marcandre | Because [] != [[]] |
| 21:43:37 | marcandre | but rec == [rec] |
| 21:43:37 | evan | yeah |
| 21:43:40 | evan | and rec != [rec] |
| 21:43:42 | evan | no |
| 21:43:43 | evan | ! |
| 21:43:43 | marcandre | nope |
| 21:43:50 | evan | why would rec == [rec] |
| 21:43:55 | marcandre | rec == [rec] == [[rec]] == rec[0] == rec[0][0] |
| 21:44:02 | marcandre | Name me a difference |
| 21:44:37 | evan | one is an array, one is that array in another array |
| 21:44:43 | evan | seems pretty different to me |
| 21:44:58 | marcandre | Both are arrays, containing one element. |
| 21:45:06 | evan | right... |
| 21:45:07 | evan | so? |
| 21:45:08 | marcandre | That element is equal because... goto previous line |
| 21:45:09 | evan | [1] != [2] |
| 21:45:35 | evan | just beacuse something is == doesn't mean they have the same hash value |
| 21:45:46 | marcandre | Let's put it this way: array1 == array2 unless they have different sizes or there is a difference in their arguments |
| 21:45:53 | evan | i did just realize you mean actualy Array#== |
| 21:46:02 | evan | and not the mathmatical property of equality |
| 21:46:04 | marcandre | evan: if they are eql? than yes, they _have_ to have the same hash value. |
| 21:46:05 | evan | which is what I meant. |
| 21:46:35 | evan | hm. |
| 21:46:40 | evan | ok. i see where you're going. |
| 21:47:00 | marcandre | I do mean Array#== |
| 21:47:34 | brixen | ok, well there is precisely one case in which this is true then: a = []; a << a; [a], [[a]] etc |
| 21:47:51 | marcandre | brixen: right |
| 21:48:00 | marcandre | But there are other "shapes" of recursive arrays |
| 21:48:06 | brixen | yes |
| 21:48:09 | marcandre | r2 = []; r2 << r2 << r2. |
| 21:48:14 | marcandre | Then [r2, r2] == r2 |
| 21:48:37 | brixen | gotcha |
| 21:48:41 | evan | well fuck. |
| 21:48:46 | evan | because i don't think 1.9 passes that |
| 21:48:50 | evan | it uses the size in the hash value |
| 21:48:59 | evan | so [r2, r2].hash != r2.hash |
| 21:49:20 | marcandre | funky = []; funky << strange = [funky]. Then rec == funky |
| 21:49:29 | marcandre | [r2, r2].hash == r2.hash. |
| 21:49:37 | brixen | yeah, it passes |
| 21:49:38 | evan | how can that be on 1.9 |
| 21:49:43 | evan | it uses the size in the hash value |
| 21:49:48 | marcandre | They both have two elements |
| 21:49:55 | evan | oh |
| 21:49:58 | evan | i misread it |
| 21:50:02 | evan | you're r2 has 2 values. |
| 21:50:14 | marcandre | I used the size in the implementation because it's an quick way to make rec.hash != r2.hash, but I didn't spec that. |
| 21:50:27 | evan | well, please add another spec that details exactly why rec.hash == [rec].hash |
| 21:50:40 | evan | a nice big comment above it would be great |
| 21:50:46 | evan | because this is quite twisty. |
| 21:50:47 | marcandre | It already exists: equal_spec! |
| 21:50:48 | brixen | marcandre: yeah, you should include at least 2 cases in this instance |
| 21:51:02 | evan | marcandre: then the test shouldn't be in hash |
| 21:51:17 | evan | or the hash spec needs a comment that mentions the equal_spec |
| 21:51:18 | marcandre | What I'll do is I'll refer to the equality thing in the specs. |
| 21:51:25 | evan | because i had no idea. |
| 21:51:38 | marcandre | That's also why you are right that my title was not correct. |
| 21:51:58 | brixen | marcandre: yes, please do document with a comment |
| 21:52:12 | brixen | the spec description string can only convey so much in this case |
| 21:52:45 | evan | the more comment on this, the better. |
| 21:52:55 | brixen | slather on the comments |
| 21:52:59 | marcandre | evan: It's not trivial to implement the right #hash, because it is the outermost call to #hash which has to return the "hash for recursive arrays" values. |
| 21:52:59 | evan | mentioning that hash has to match up with eql is important in this. |
| 21:53:13 | evan | oh |
| 21:53:14 | evan | i know. |
| 21:53:15 | evan | :) |
| 21:53:15 | brixen | don't be worried about high cholesterol |
| 21:53:19 | evan | i'm poking at it now. |
| 21:53:47 | marcandre | I'll fix the specs now. Let me know if you'd like me to help with the implementation in rubinius. |
| 21:53:57 | marcandre | I almost feel responsible for the trouble ;-) |
| 21:55:03 | brixen | marcandre: and you are! it's all your fault for trying to bring some consistency to MRI |
| 21:55:06 | brixen | :) |
| 21:59:31 | marcandre | Done |
| 22:01:01 | marcandre | brixen: I know :-) Hey, we never celebrated the birth of Object#<=>. Bring the champagne next time ;-) |
| 22:01:34 | brixen | heh |
| 22:01:59 | brixen | marcandre: I don't mean to be a pain, but can you actually add a comment that states the condition for Array#== |
| 22:02:06 | brixen | unless it's there and I'm missing it |
| 22:02:29 | brixen | "same elements in the same order" / something |
| 22:02:56 | brixen | and explain why that impacts recursive array hashes |
| 22:03:08 | marcandre | I guess we can wait until it can be spec'ed out. I'm still waiting on Matz to explain what he wanted. |
| 22:03:33 | marcandre | Oh, yeah. I checked Hash#eql? and that was ok, so I assumed I did it for arrays too. |
| 22:03:49 | brixen | oh, I didn't look at Hash#eql? |
| 22:04:46 | marcandre | Ah, ujihisa actually wrote the recursive Array#eql? specs. I'm commenting them now. |
| 22:05:00 | brixen | ah, ok. thanks |
| 22:11:29 | ddub | recursive collection equivalence, *shiver* |
| 22:17:08 | marcandre | I hope this is a bit more clear. |
| 22:18:15 | marcandre | Ah, there's struct also... |
| 22:19:20 | marcandre | Well, just the way I worded the == spec makes it more clear. I'm commenting Struct#hash |
| 23:21:34 | brixen | crosses fingers |
| 23:21:41 | brixen | doing a clean build now |
| 23:59:27 | boyscout | Fix a few last Array spec failures - 61a46c9 - Evan Phoenix |
| 23:59:27 | boyscout | Wrap specs that rubinius doesn't support in not_complaint_on - eb4e095 - Evan Phoenix |
| 23:59:27 | boyscout | Update Array tags - 1824ab5 - Evan Phoenix |
| 23:59:35 | evan | ok, Array is good. |
| 23:59:50 | evan | the only fail tags are now because we're missing an implementation of permutation |
| 23:59:55 | evan | i'll let someone else do that. |