Index

Show enters and exits. Hide enters and exits.

00:17:11sandalFinally officially announced that I'll be starting on Unity (the web based RubySpec interface)
00:17:15sandalhttp://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/338428
00:17:26sandalNow I can maybe stop pandering and start coming up with a plan :)
00:34:12brixensandal_: nice post on RBP :)
00:35:05brixensandal_: small typo, it's Brain Fart not Brain Ford :P
00:35:16sandalhahaha
01:09:21ddubI should go home and see what happened with my new roomba
01:11:21brixenddub: like see if it washed your couch or gave birth?
01:13:37ddublittle roombas running around :D
01:14:21ddubhow tiny are baby roombii though? are they like cleaning nanites?
01:14:48evanmore like scrubbing bubbles
01:15:07ddubgreat minds think alike :)
01:15:35ddubmakes sure he can feed them lots of dust and metal shavings so they grow up big and strong
01:16:37brixenthat would be pretty awesome, little scrubbers consuming dirt and growing into big scrubbers
01:16:54brixenmight get big enought to consume cities thoug :/
01:19:17brixenwtf vim, why did you suddenly quit wrapping my text
01:20:21evanare you in paste mode?
01:20:46brixenum, how would I tell?
01:20:52evando
01:20:53evan:se nopaste
01:20:55evanjust to be sure
01:22:09brixenok, did that, but it still doesn't wrap
01:22:16evanhm.
01:22:36brixenit was wrapping and I reopened the file and it quit
01:22:38brixenweird
01:24:48dgtizedevan: so I see you changed Array#at to do the work of the primitive -- I guess we can't actually strip that primitive since the the vm needs it?
01:25:15evani didn't disable the primitive
01:25:20evanwe're still using it
01:25:29evanI just left a feature complete version of Array#at there
01:25:45evanwhich is what all performance prims should do
01:26:12dgtizedah nm, I misread
01:27:15dgtizedwould it make sense to include feature complete versions of say Tuple#copy_from in ruby?
01:27:45evanyes.
01:29:07dgtizedalso it was probably my fault that there was a large number of if('s in array, I'll try and remember to avoid that
01:30:21evanyes, it was :)
01:30:24evangit blame said so
01:32:04dgtizedok for Tuple#copy_from, currently the alternate case is just to fall back to a raise PrimitiveFailure, I guess if we have an actual fall back solution that should be the case?
01:32:16dgtizedwhat is the actual usage intended for PrimitiveFailure?
01:32:41evanTypeErrors and explicit calls to Primitive::failure()
01:32:49evanie, the primitive itself can say "nope, this isn't going to work"
01:32:52evanthen the ruby code is run
01:33:38dgtizedhmm, so I guess in this case it means the ruby solution needs to guard the arguments as fixnum's?
01:34:01dgtizedas extra work beyond the prim failure?
01:34:37evan"needs to guard"
01:34:38evanwhats that mean?
01:36:19dgtizedwell currently the only case that would cause the PrimitiveFailure is if the arguments are not Array, Fixnum, Fixnum, Fixnum
01:36:37evanright
01:36:54evanthere are a couple ways to handel things
01:37:00dgtizedso in replacement for the PrimitiveFailure that triggers if that is not the case, we should explicit type guards correct?
01:37:00evanyou could just convert them and call the method again
01:37:57dgtizedwell presumably this is a method that if possible it would be nice to inline in the jit at some point if we could remove the primitive
01:38:09dgtizedso just calling the method again is kind of silly
01:39:24evani'd prefer we not design any code around "this is going to be inlined"
01:39:31evanwe've got no clue how thats going to work yet
01:39:39evani don't want us to make those kinds of decisions
01:40:53rueInlining pretty much does not work if the code cannot be assumed to work on its own
01:41:01rueExcept *actually* inlining it
01:41:44dgtizedwait wait -- copy_from is purely a performance primitive to move whole regions of a tuple into another tuple
01:42:04dgtizedso what I'm doing is rewriting the primitive failure case so that it just executes the copy code in ruby
01:42:40dgtizedbut I'm just making sure that we aren't changing the possible error conditions by reverting to the ruby code from the primitive dispatch
01:43:26evanok
01:43:33dgtizedthe same can be done for Tuple#delete
01:43:36evanso you're assuming that it should raise a TypeError if someone doesn't pass in a Fixnum?
01:44:03slavaevan: I think a good strategy is to do all type checks in ruby-land
01:44:09slavathis way the compiler can 'see' them and optimize them out
01:44:43dgtizedoh right -- I'd forgetten, ok so actually there is no case in which the PrimitiveFailure can occur, just the TypeErrors from the primitive bridge code
01:45:34evandgtized: ruby code thats not boilerplate fallback code for a primitive should NOT raise PrimitiveFailure
01:46:12dgtizedevan: ah -- that makes sense, ok
01:58:55dgtizedslava: we do most of our type checks there, but the primitive code is a weird special case
02:16:07dgtizedactually, this would be pretty good if we had pure ruby implementations of all these things, it should speed up attempts like jruby to use our kernel
02:21:18sandalbrixen: I totally didn't catch your ref to the typo before... sorry!
02:21:23sandalUpdating now
02:21:47brixensandal_: heh, n/p
02:22:59sandalhttp://github.com/sandal/rbp-blog/commit/9314b664ecc1ee06b37e0170499d0f027e916fbe
02:24:04brixenhehe
02:24:05brixennice
02:25:33brixenwell, the 70 mph winds have died down, so I'm going to drive home
02:25:38brixenbbiab..
02:45:27rueMaybe it was just laying low to trick brixen into exiting
08:29:08boyscoutAdded correct max_loop calculation for cuckoo hash. - be4b11a - Brian Ford
08:29:08boyscoutConvert cuckoo hash to a single, divided table. - ac34fae - Brian Ford
08:29:08boyscoutReworked cuckoo hash insert. - 09e9635 - Brian Ford
08:29:08boyscoutAdded place for experiments to the documentation. - 3fd6627 - Brian Ford
08:29:08boyscoutAdded code, results for Hash performance experiments. - 57acca5 - Brian Ford
08:29:38brixenevan: take a look at doc/experiments
08:30:07brixenmake sure I didn't make any obvious blunders in explanation :)
08:39:22evanok
08:39:25evani'm about to head to bed
17:45:16evanmorning
17:46:37marcandreafternoon
17:47:20brixenmorning
17:47:31brixenmornings win, 2-1 :)
17:48:15marcandrebrixen: I'm still thinking about that nil <=> 0 business.
17:48:28marcandreI was amazed at how < and > work for Modules...
17:48:39marcandreIt works the way you were suggesting!
17:49:02brixenoh?
17:49:06marcandreI.e. it returns true, false, or nil if they are both modules but have no relation to each other!
17:49:13brixenI see
17:49:45brixenin a sense a < b => nil makes sense in a boolean context
17:50:03brixenit _is_ false in the extended set { nil, true, false }
17:50:15brixenI doubt that change will fly with matz though
17:50:16marcandreAlso, Module.is_a? Comparable returns false
17:50:25evanfor instance, how can you compare a car to an apple?
17:50:32evanthat would return nil
17:50:58marcandreModule will raise an error if you try to compare a Module with other stuff, say a string.
17:51:03brixenyeah, not comparable for the relational ops could raise or return nil
17:51:25marcandreIt will return nil only if they both are Modules but can't be ordered.
17:52:20marcandreSo the graph or set example of partially ordered objects could therefore return nil between themselves and raise when comparing with other classes.
17:52:33evanconsistency!
17:52:34evan:/
17:53:13marcandreThe problem is that if we follow this logic, Object.new < Object.new should return nil, and not raise an error.
17:53:40marcandreI mean if we push to have an Object#<=> defined (and >, ...)
17:55:14marcandreSo I'm even less sure what to suggest to ruby-core anymore.
18:09:13rueI do not think an Object#<=> is appropriate
18:10:35rueSet semantics, fix Comparable and any core stuff that defines <=>
18:11:05rueI do not understand what the aversion to a NoMethodError is (unless I have misinterpreted that point of contention)
18:11:35brixenrue: well, why should it ever get a NME
18:11:52brixenany 2 objects a, b have a well defined result for #<=>
18:12:19rueNot if you have not defined such a result
18:12:40rue`someobject <=> other` should raise a NoMethodError, if #<=> is not implemented
18:12:41brixenthe asymmetry between 0 <=> nil and nil <=> 0 is just nonsense
18:13:06brixenrue: the result of #<=> is easily defined
18:13:15brixenthere is no reason to have NME raised
18:13:39rueNot really
18:15:28rueThe two above are distinctly different things
18:16:40rueI suppose my formulation is that you cannot fully define Object#<=>
18:17:05rueYou can, sure, define it to always return nil or raise or whatever, but not to return the "real" result of -1, 0, 1
18:17:17rueTherefore it is inappropriate to implement it that way
18:17:21boyscoutFixed bench:to_csv to emit the correct bench name. - 8ef4866 - Brian Ford
18:26:32marcandrerue: I think the main points of contention are: 0 <=> nil returns nil, but nil <=> 0 raises a NME. 0 > nil and nil < 0 raise different errors. Finally, nil == 0 returns false, but nil <=> 0 raises an error.
18:27:26marcandreWhat I'm wondering is: what is the downside of having Object#<=>(obj) being defined and returning obj<=>(self), or nil if recursing?
18:28:17brixenmarcandre: well, one downside I see is sanity, there's far too much of that around /sarcasm :)
18:28:19rueWell, first, you would have to implement it as the *reverse* of that
18:29:41marcandreYes, indeed, -1 and 1 need to be mapped to 1 and -1 respectively.
18:30:19rueSecondly, the recursion
18:30:23rueSelf- and mutual
18:30:39marcandrerb_exec_recursive will take care of that easily.
18:31:15rueThirdly, NoMethodError means "invalid operation"
18:32:00rueWhy are we hiding the fact that you cannot compare nil with shit?
18:32:08marcandreYes. I'm wondering how that is more useful than getting 'nil'
18:32:36marcandreIf you really couldn't compare nil with anything, why is 0 <=> nil not raising an error?
18:32:55rueBecause Fixnum is stupid enough to somehow "convert" nil to a value it can use
18:33:00rueWhich is its choice
18:33:34marcandreSame with "" <=> nil, btw...
18:34:30marcandreI think that's the crux of the problem. 0 <=> nil should have the same (inverse) behavior as nil <=> 0.
18:34:37rueNo, it should not
18:34:43marcandreBe that raising a meaningful error, or returning nil.
18:34:55rueSorry, no, it should not /have to/ have
18:35:11marcandreOf course, I mean, "I think".
18:35:36rueIt would set a precedent that either coercion is disallowed, or then expected
18:36:21rueOne thing is clear, though: if using #<=> raises an error (of any kind), it means the user done fucked up
18:36:21marcandreI'm not sure I follow.
18:37:24marcandreYes, indeed.
18:37:58marcandreBut why is "nil <=> 0" a f*ck up but not "0 <=> nil"?
18:38:11rueBecause that is what Fixnum#<=> decided to do
18:38:30marcandreWell, is that the right thing to do?
18:38:33rueSo, the problem is not a missing Object#<=>, but (possibly) the definitions of #<=> in the core
18:39:38rueRight, that is the question. It has two aspects
18:40:02rue1. Should #<=> be "allowed" to coerce its argument? (I.e., is this conventionally used)
18:41:06rue2. Should an invalid object given to a defined #<=>, say, Fixnum's, raise (something), return nil, or do one or the other?
18:41:18marcandreWhen doing 0 <=> nil, is nil coerced to a fixnum?
18:41:52rue#<=> is defined to return -1, 0, or 1; not nil. Therefore, I think the answer to #2 is to always raise if the argument is not understood
18:42:41marcandreI think you are mistaken
18:42:56marcandre#<=> is defined to return any of -1, 0, 1 or nil.
18:43:15rueNope
18:43:31rueLet me rephrase
18:44:15rueThe semantics of #<=> call for a return value of -1, 0 or 1. The normal way to handle errors is with errors. nil is not a semantically valid result of #<=>
18:44:28ddubrue look at Module#<=>
18:44:36rueThat it is *currently implemented* that way is a different matter
18:45:14marcandreOh, please don't look at Module#<=>, because Module order is different than everywhere else!
18:45:35rueddub: Conversely, look at the documentation of Fixnum#<=>
18:45:42rueNot that it actually follows it but anyway
18:45:54rueThere is nothing gained by returning nil
18:45:59marcandreSection 4.6.6 from Matz's book states "And if the two operands are not comparable, it returns nil."
18:46:22evanelk <=> airplane # => nil
18:46:24rueWhereas raising allows users to do a simple rescue, which will catch both NoMethodError and whatever else
18:46:54rueevan: No, `elk <=> airplane # => NoMethodError` (or TypeError if you prefer)
18:47:07marcandreI can understand that personal preferences may differ, but I think this is moot.
18:47:47marcandreI believe the definition of <=>, as per Matz's book and implementation of all <=> operators are clear: one should return nil when not comparable.
18:47:52evanrue: I do prefer
18:47:54rueAnd never raise?
18:48:02rue#<=> should never raise?
18:48:35marcandreWell, I'd like that to be the case!
18:49:10marcandreAnd the rationale is as follows: there is a return value already defined for stuff that can't be compared and that's "nil".
18:49:26marcandreSome may or may not like that, but that's the current definition.
18:49:40rueWhen using the method, you then have two branches for processing the result
18:50:01marcandreMaybe this could be changed for "nil" if things are of the same "kind" but can't be ordered (e.g. Graphs, Modules, etc...) and raise otherwise
18:50:18rueI think that is overloading the method
18:50:27rueOr, more impolitely, using the wrong method
18:50:27ddubO
18:50:56marcandreBut the current situation is a mix of the two: sometimes return nil, sometimes raise, and I think that's the worst situation.
18:51:22ddubit would be nice if it did raise a type error when it wasn't able to do a comparison, vs. returning nil. Although I suppose you can catch that case and attempt to reverse the arguments (and negate the result)
18:52:24rueSo, to use more traditional version of evan's line above:
18:52:32rue"Compare these apples with these oranges"
18:52:43rueMy answer is "N-uh, can't do that sah"
18:53:24marcandreAs long as you give one answer, I'll be happy :-)
18:53:40brixenreturning nil and raising are equivalent, one returns an undefined value for the function, one modifies state
18:54:00brixenhere the advantage of returning nil is that it has a boolean semantic
18:54:06rueThey are not equivalent, because the set of possible return values is not the same.
18:54:59rueAnd, since -1, 0, 1 do not have boolean semantics, nil having is of little value. It means there is a branch at the return value
18:55:43marcandreI believe we have to see <=> as an operator returning one of four possibilities.
18:55:53rueI disagree
18:55:59marcandreIt could have been :equal, :smaller, :bigger, :different
18:56:02rueIt returns one of three, or fails
18:56:06marcandreIt is 0, -1, 1, nil
18:56:21marcandreIt could have been 0, -1, 1, raise
18:56:44marcandreNo matter what, you have four possibilities.
18:57:20marcandreBut currently there are 5. I'd like to have nil and raise be "merged".
18:57:26rueI am not sure I have confidence that never raising will be adhered to.
18:58:12marcandreOr else given different meanings, like nil is for partially ordered objects that can't be ordered (e.g. Modules) and raise for different classes that can't be compared
18:58:16ruePlus it leaves the difficulty of an undefined #<=>. raising seems to be a simpler solution, and it does not require adding an unnecessary method
18:59:42ruemarcandre: I would raise in both cases, the comparison is not possible and the user should not try to do it. 'Course can define different error classes, if so desired
18:59:54rueAmbiguousError
19:00:12marcandreYou mean that String <=> FalseClass should raise an error?
19:00:27marcandreWow, that's very extreme!
19:00:37rueYes
19:00:40marcandreI see exceptions as signs you have screwed up.
19:00:45rueYou HAVE
19:01:09marcandreAnd if I have two classes and want to know if there's a relationship between them, I don't feel that asking the question is a screw up!
19:01:13rueIf you cannot define the -1, 0, 1 relationship, then you should use a different comparison method
19:01:32brixenthat is totally not true
19:01:37ruemarcandre: Ah, but you are not asking IF there is a relationship
19:01:41brixen1 / 0 is not defined on reals
19:01:46rueYou are asking WHAT the relationship is
19:01:50brixenbut extended reals have Inf
19:02:13brixenyou can extend the set { -1, 0, 1 } to include nil the same way
19:02:54marcandrerue: Indeed, I'm asking the question "is there a relationship and if so what is it"
19:03:00ruemarcandre: To find out IF they are related, you could conceivably use #< or #>, or check #ancestors, or #include?
19:03:03marcandreThat's the efficient way to define it.
19:04:40marcandreThe efficient (and I feel natural) way to ask that is <=>. I think that's what it was meant to be (as per the doc), and I find if (again, that's personal) very efficient and useful that it returns nil.
19:04:40rue#<=> is not relation, it is comparison
19:05:20brixenum ok
19:05:21marcandreyes. And the natural comparison for Modules, Sets, Graphs, ..., is inclusion.
19:06:17marcandreDamn, gotta go...
19:07:37marcandreI'll try to put some of these thoughts properly on paper and come back here before sending it to ruby-core. rue, you can write the dissent ;-)
19:08:17rueI am not going to bother to do that
19:08:44marcandreIndeed, Matz will probaly do that really quickly anyways ;-)
19:08:46rueYou guys are way, way overloading one single method, and you all can figure out how in the fuck to support the construct
19:09:19evanwe're not doing it
19:09:21evanruby does it.
19:09:37marcandrebrixen: not sure what you mean by boolean stuff for { -1, 0, 1, nil }. Maybe you can tell me later?
19:09:44rueAlways raising is the simplest way both to implement, and for the user to work with, but it does not support overloaded semantics.
19:10:03brixenmarcandre: sure, it's elementary function stuff
19:10:13brixenmarcandre: you already understand the math
19:10:34rueNice passive-aggressiveness again, asshole
19:10:35brixenmarcandre: just use the reals and extended reals as an analogue
19:11:04marcandrerue: who are you calling that?
19:11:10brixenmarcandre: me
19:11:13brixendon't worry
19:11:14brixen:)
19:11:18evandude.
19:11:20evanle sigh.
19:11:44brixenit's a matter of opinion whether raising or returning nil is "correct"
19:11:54brixenprecendence favors nil
19:12:10brixenanalogous stuff with the reals for instance does too
19:12:14brixenanyway...
19:12:38marcandreWow.
19:13:04marcandreAnyways. It's sunny outside, I'm going to play beach-volley.
19:13:09brixenfun!
19:13:14brixenit's rainy here :(
19:14:47marcandreI have a lot of difficulty coping with aggresivity and I seriously hope not to witness it.
19:14:56marcandreCheers, and talk to you later.
19:16:22brixenmarcandre: cheers mate
19:16:27brixendon't let it bother you
19:23:16aiclusDo you know Diamondback Ruby (DRuby) http://www.cs.umd.edu/projects/PL/druby/
19:23:27evanyeah, we've seen it.
19:23:27aicluswould rubinius benefit from type inference?
19:23:48evanmaybe
19:23:54evandunno
19:24:00evanwe'd have to figure out a way to use it.
19:24:22aiclusI like the idea of annotations as comments!
19:25:14evanTI in ruby is hard
19:25:19evanfor instance
19:25:22evandef foo(a)
19:25:24evan a + 50
19:25:25evanend
19:25:30evaneven if you can reason that a is a Fixnum
19:25:40evanyou can't reason about the return value of + without knowing a's value
19:25:55evanwell, you can't reason that it's Fixnum
19:26:02brixenaiclus: I like the idea of class methods better: http://gist.github.com/124415
19:26:17brixenaiclus: more like haskell
19:27:08aiclushmm but it changes code
19:27:10brixenbut yes, the bigger issue is that "type" is not well defined in Ruby
19:27:26brixenaiclus: it's easy to define Module#type as a noop
19:27:40brixenI dislike magic comments for the most part
19:27:49brixenencoding magic comments work ok
19:28:38brixenaiclus: it'd be interesting to add some static analysis stuff to rbx
19:28:45brixenaiclus: are you interested in that?
19:29:22aiclusbut type information is beneficial I some simple format should be defined for it ...
19:32:09brixenonly 8 failures, 7 errors in mspec ci after updating rubyspec
19:32:12brixenthat's pretty cool
19:32:25brixenlots of rubyspec activity lately too
19:32:45brixenone is a bytecode generation error though, hmm
19:34:43brixenevan: who was working on AccessVariable? adding #arity and stuff?
19:35:00evanum....
19:35:07evani don't recall
20:26:12boyscoutimplemented pure ruby fallback for Tuple#copy_from - 36cc23d - Charles Comstock
20:26:12boyscoutimplemented pure ruby fall back from primitive for Tuple#delete - f57a8fc - Charles Comstock
23:22:32tarcieriheh, weird
23:23:04brixenindeed
23:23:09tarcieriso I guess the PyPy guy I talked to is Maciej Fijalkowski
23:23:24tarcieriand rumor has it he's about to announce a JIT that's faster than CPython
23:23:32brixenwow, sweet
23:23:38brixenany code we can see?
23:24:27tarcierilol, so the way this was phrased in the email
23:24:38slavaa jit faster than cpython? something sounds wrong here
23:25:05tarcieri" Maciej asked me not to pre-announce that his JIT might be working and running Python faster than CPython does. So, I'm not pre-announcing that, so if it does, then it will be a surprise."
23:25:13tarcierilol
23:25:17brixenheh
23:27:14slavawhy would a jit not be as fast or faster than CPython?
23:27:30tarcieriI think the important thing is that it's working
23:27:40slavathat's not so impressive either :)
23:27:44tarcieriheh
23:27:53tarcieriworking code is always more impressive than non-working code!
23:58:34brixenjarib: ping