Show enters and exits. Hide enters and exits.
| 00:22:13 | rue | Hum hum |
| 00:31:12 | defn52 | goes to get dinner |
| 00:51:35 | hookET enters the room. | |
| 01:30:24 | cabo enters the room. | |
| 01:37:13 | zedas leaves the room. | |
| 01:44:34 | bricolage_ leaves the room. | |
| 02:19:45 | hookET leaves the room. | |
| 02:54:13 | mae | helloooo |
| 02:55:02 | boyscout | cabo * [656] /rubinius/trunk (kernel/bootstrap/context.rb lib/bytecode/compiler.rb) Temporary fix for #40 until evan figures out the permanent fix. |
| 02:56:41 | mae | evan ?? |
| 02:56:48 | mae | you want side effects with -e? |
| 03:01:36 | cabo | Could someone please check in new .rbas? Mine are too tainted by debug output and I don't want to have another huhu event. |
| 03:01:53 | tlockney leaves the room. | |
| 03:01:54 | cabo | Oh, and you HAVE TO REMOVE ALL .rbc due to the compiler change. |
| 03:02:29 | cabo | Compiler changes are not currently considered by the build process. |
| 03:02:55 | cabo | anybody awake? |
| 03:03:47 | rue | There is nobody here but us dust bunnies |
| 03:05:56 | mae | i'll do it cabo |
| 03:06:12 | cabo | Oops, my fix also made Rubinius 20 % faster. |
| 03:06:24 | rue | Heh |
| 03:06:32 | boyscout | hurdlea * [657] /rubinius/trunk (kernel/core/regexp.rb runtime/core.rba spec/core/matchdata_spec.rb) * Added MatchData#values_at |
| 03:06:32 | boyscout | * Fixed implementation of MatchData#select |
| 03:06:32 | boyscout | * Updated specs for MatchData#values_at, select |
| 03:07:19 | mae | find . -iname *.rbc -print0 | xargs -0 rm -f |
| 03:09:59 | rue | Interesting change |
| 03:11:03 | boyscout | mae * [658] /rubinius/trunk (5 files) new rba's for cabo -- and updated reports |
| 03:16:35 | mae | anyone know why evan cussed about the side effect change to -e |
| 03:17:53 | rue | Ew dunno |
| 03:23:05 | cabo | it was a change |
| 03:23:12 | cabo | and it surprised me, too |
| 03:23:18 | cabo | I was starting to hunt the bug |
| 03:23:27 | cabo | that mysteriously suppressed the output |
| 03:24:16 | rue | Hm. shotgun/rubinius -dc -dl -e '[[1,2]].each {|a, b| p a, b}' |
| 03:24:26 | rue | Is partially addressed by that change too |
| 03:24:55 | cabo | partially? |
| 03:25:34 | rue | Well, it changes the output I should say |
| 03:26:47 | rue | Previously it printed 2, Tuple... whereas now it is [1, 2], nil |
| 03:28:09 | hurdlea | hi, I just svn up and I have a broken build |
| 03:28:25 | rue | hurdlea, did you get 657 also? |
| 03:28:32 | hurdlea | I am getting => No method 'to_sym' on an instance of Tuple. (NoMethodError) |
| 03:28:38 | rue | And remove all .rbc? |
| 03:29:53 | hurdlea | rue: I have deleted rbc's and rebuilding now |
| 03:37:57 | hurdlea | Hmm, still have a problem http://pastie.caboo.se/37646 |
| 03:39:26 | rue | Why do we have lib/bytecode and native/bytecode again? |
| 03:42:43 | rue | That is weird |
| 03:43:28 | rue | hurdlea, Regexp#quote is not in the repo yet? |
| 03:44:14 | rue | Oh, nevermind, it is aliased |
| 03:50:40 | brixen | hurdlea: fwiw, I have r658, deleted all rbc and did build:rubinius and I don't get an error on [[1,2]].each {|a, b| p a, b} => [1, 2]\n nil |
| 03:51:22 | rue | Same here |
| 03:51:36 | rue | I am not sure how you are getting to Regexp.quote anyway actually |
| 03:53:45 | rue | Ha, another flag. DEBUG_ASSEMBLER |
| 03:53:51 | boyscout | mae * [659] /rubinius/trunk (bin/reports/compare.rb reports/completeness.html) made completeness report grok bootstrap for system errors -- cabo can we make those ruby or do they have to be c? |
| 03:55:15 | mae | its looking promising :) |
| 03:55:16 | mae | http://rubini.us/rubinius/repository/file/trunk/reports/completeness.html?format=raw |
| 03:56:07 | hurdlea | ok, I'll try a fresh checkout |
| 03:57:11 | hurdlea leaves the room. | |
| 03:57:52 | mae | cvdecl |
| 03:58:06 | mae | can we turn this sexp into sugar for meta instance |
| 04:00:18 | rue | Do what? |
| 04:00:47 | cabo | mae: they have to be c |
| 04:00:48 | cabo | bbl |
| 04:03:26 | blink | Does rubinius still require gcc4 to compile? ;/ |
| 04:07:39 | rue | Yes |
| 04:08:03 | blink | damn. |
| 04:08:38 | mae | in the compiler how do i get the meta class |
| 04:08:44 | mae | add "push self" is current instance |
| 04:38:12 | nutrimatt enters the room. | |
| 04:39:59 | rue | Hm. GDB is not too useful in stepping through the ruby parts, eh? :/ |
| 04:41:41 | mae | bwahaha |
| 04:49:42 | mae | so um |
| 04:57:36 | rue | Indeed |
| 04:58:23 | mae | i need help |
| 04:58:29 | mae | who is compiler expert |
| 04:58:38 | mae | http://pastie.caboo.se/37648 |
| 04:59:55 | mae | i'm trying to make @@x = 1 the same as self.class.instance_eval { @x = 1 } |
| 05:02:17 | rue | It has been decided, breaking compatibility and all? |
| 05:04:10 | mae | um |
| 05:04:21 | mae | well it will not really break compatibility |
| 05:04:25 | mae | it will work pretty much the same |
| 05:05:20 | rue | But it does. @@ are shared in a hierarchy |
| 05:05:55 | mae | if Class === self then its (class << self; self; end).instance_eval |
| 05:06:25 | mae | if its != Class then its self.class.instance_Eval |
| 05:06:39 | mae | it would be shared in a hierarchy |
| 05:07:13 | chris2 enters the room. | |
| 05:07:29 | rue | Then that would break compatibility with @. Unless those two behave differently in which case the two are not the same |
| 05:07:43 | mae | basically the same behavior can be emulated |
| 05:07:46 | mae | yeah i don't mean exactly |
| 05:07:52 | mae | well in some ways mri class vars suck |
| 05:07:54 | rue | But Ruby has different semantics for @@ and @ |
| 05:09:15 | rue | chris2, morning. Early one for you, eh? |
| 05:10:00 | chris2 | 11am... |
| 05:10:04 | rue | mae, basically you would always have to detect whether a superclass defines that class variable and change it THERE |
| 05:10:51 | mae | well |
| 05:11:02 | mae | is the hierarchy useful for anything really |
| 05:11:13 | rue | Not really, but that is beside the point :) |
| 05:11:17 | mae | lol |
| 05:11:57 | mae | they are a wart |
| 05:12:05 | mae | i think they should be annihilated |
| 05:12:18 | rue | This would not be extra functionality which is easier to pass through, it would be a change |
| 05:12:24 | rue | chris2, pretty early |
| 05:12:40 | chris2 | usually, i have to wake up at 6.30am... |
| 05:14:08 | mae | rue: yeah i think it needs more discussion |
| 05:14:11 | mae | i wish we could get matz in here |
| 05:16:27 | defn52 leaves the room. | |
| 05:17:02 | rue | I think they are being changed for 1.9 actually |
| 05:21:49 | rue | OK, autovivification of labels is messing me up |
| 05:23:54 | mae | i don't understand why we need class vars |
| 05:24:32 | mae | http://www.oreillynet.com/ruby/blog/2007/01/nubygems_dont_use_class_variab_1.html |
| 05:24:43 | rue | If 1.8 compatibility is needed then class variables are needed |
| 05:24:45 | mae | http://eigenclass.org/hiki.rb?Changes+in+Ruby+1.9 |
| 05:25:12 | mae | rue: class variables are pretty useless, those that use them can spend very little time to refactor them into class instance vars |
| 05:25:52 | rue | Well, I would argue otherwise unless we target 1.9 |
| 05:26:01 | mae | http://railstips.org/2006/11/18/class-and-instance-variables-in-ruby |
| 05:26:30 | mae | rue: i'll bet you that if we just made @@ behave like instance variables most stuff would still work fine |
| 05:26:43 | mae | theres not many people that depend on the crazy behavior of class vars |
| 05:27:05 | rue | Talk to evan and see what he says. I certainly would not miss class variables but compatibility breakage is always bad |
| 05:27:33 | mae | rue: why don't we just do the instance "hack" and put a big DEPRECATION notice in big letter s:) |
| 05:27:37 | mae | as long as it behaves the same |
| 05:27:49 | mae | that way we don't have to pollute the vm |
| 05:39:50 | mae | rue: class vars are crazy and useless: http://pastie.caboo.se/37649 |
| 05:40:02 | mae | if anyone is writing code that depends on this behavior they should be shot |
| 05:40:44 | rue | You can give all the arguments you want but it is still 1.8 behaviour |
| 05:41:03 | mae | rue: it doesn't matter, find me one project that depends on that behavior that means anything |
| 05:41:38 | mae | we're also breaking compatibility with defined? to just return true/false rather than strings |
| 05:41:52 | mae | because its totally never used and pretty much worthless |
| 05:42:13 | rue | Yes, it does matter. It is just a question of breaking compatibility and I am the wrong person to talk about that |
| 05:42:27 | rue | s/talk/talk to/ |
| 05:42:59 | mae | rue: we're not breaking "important" compatibility |
| 05:43:26 | mae | most people use class vars as a glorified constant |
| 05:43:45 | mae | or global var for that matter |
| 05:43:52 | rue | I am not going to argue further, it is not my decision. |
| 05:43:56 | mae | heh |
| 05:44:09 | mae | salutes rue |
| 05:44:12 | mae | bedtime for me |
| 06:20:05 | rue | Hm. A method call always has an array to hold arguments |
| 06:31:30 | rue | I am manually stepping through a program. Oh joy of joys |
| 06:57:31 | mitsuhiko leaves the room. | |
| 08:19:30 | jadams_ enters the room. | |
| 08:20:51 | jadams leaves the room. | |
| 08:52:31 | jadams_ leaves the room. | |
| 09:08:35 | cabo | Was Tuple#each broken all the time or did I break it in 657? http://pastie.caboo.se/37667 |
| 09:35:04 | cabo | Oh, the compiler breaks that one. Bytecode::MethodDescription#encode_literals |
| 09:35:28 | pate | rue, still here? |
| 09:38:12 | cabo | Oops, OMSIZE Heisenbug. |
| 09:39:19 | pate leaves the room. | |
| 09:47:28 | cabo | It all comes back to this MRI gem: http://pastie.caboo.se/37669 |
| 09:47:44 | cabo | It seems I cannot work on this without a serious course in MRI splatology. |
| 09:51:21 | boyscout | cabo * [660] /rubinius/trunk/shotgun/lib/rubinius.c (Fix an indento.) |
| 09:57:27 | boyscout | cabo * [661] /rubinius/trunk/shotgun/lib/object_memory.c Fix stylo; remove OMSize diagnostic so specs can be run reasonably with RUBINIUS_OMSIZE set. |
| 10:06:17 | lopex enters the room. | |
| 10:31:55 | hookET enters the room. | |
| 10:46:39 | tlockney enters the room. | |
| 10:56:35 | hookET leaves the room. | |
| 11:00:12 | chris2 leaves the room. | |
| 11:00:12 | lopex leaves the room. | |
| 11:00:12 | evanfarrar leaves the room. | |
| 11:00:13 | nutrimatt leaves the room. | |
| 11:00:13 | cabo leaves the room. | |
| 11:00:13 | headius leaves the room. | |
| 11:00:13 | wnight leaves the room. | |
| 11:06:28 | rue enters the room. | |
| 11:10:16 | cabo leaves the room. | |
| 11:14:46 | boyscout | cabo * [662] /rubinius/trunk (7 files) Start work on String#[]= |
| 11:14:46 | boyscout | In the process, fix CHARACTERS "lameness" |
| 11:18:58 | mae enters the room. | |
| 12:47:08 | zedas enters the room. | |
| 12:58:26 | nicksieger enters the room. | |
| 13:26:27 | mae | i got my PhD in splatology from IRC U |
| 13:35:46 | mae | hi nick |
| 13:37:20 | tlockney leaves the room. | |
| 13:47:57 | mae | evan JOO bastard |
| 14:05:05 | cabo` | mae: So can you explain http://pastie.caboo.se/37669 to me, pretty please? |
| 14:12:59 | chris2 leaves the room. | |
| 14:14:27 | jadams leaves the room. | |
| 14:18:39 | mae | wasn't mine |
| 14:20:41 | cabo`` enters the room. | |
| 14:20:54 | mae | cabo``: wasn't mine |
| 14:21:01 | cabo` leaves the room. | |
| 14:23:30 | wnight leaves the room. | |
| 14:38:50 | wagonee enters the room. | |
| 14:41:07 | nutrimatt leaves the room. | |
| 14:56:55 | mae | time for me to do some hw |
| 15:00:32 | mae | bbl |
| 15:28:59 | mae | how do i test something is an object in a primitive |
| 15:40:32 | cabo`` | mae: Everything is an object. |
| 15:40:41 | mae | o |
| 15:40:42 | mae | k |
| 15:40:42 | mae | :) |
| 15:40:46 | cabo`` | Do you mean non-immediate? REFERENCE_P |
| 15:40:53 | mae | ah ok |
| 15:41:16 | cabo`` | rubinius.h makes really good reading. |
| 15:41:23 | cabo`` | Too bad it's off in include/ |
| 15:41:50 | mae | when primitives are getting built which header files are included |
| 15:42:01 | mae | STRING_P is defined in string.c |
| 15:43:54 | mae | #define TRUE 1 |
| 15:43:56 | mae | why do we have this |
| 15:44:00 | mae | c99 defines a bool type |
| 15:52:51 | mae | a FIXNUM is not a reference right? |
| 16:01:29 | defn52 enters the room. | |
| 16:04:47 | mae | hey def |
| 16:09:42 | defn52 | hey |
| 16:16:18 | boyscout | mae * [663] /rubinius/trunk (runtime/compiler.rba shotgun/lib/cpu_primitives.c shotgun/lib/primitives.rb) primitives cleanup any experienced people please look at FIXME's |
| 16:21:51 | rue | Morning |
| 16:23:51 | mae | morning |
| 16:24:33 | rue | cabo``, the pastie seems correct to me. What is the problem there? |
| 16:27:34 | mae | can anyone explain create_pipe in primitives.rb to me |
| 16:27:47 | defn52_ enters the room. | |
| 16:28:35 | cabo`` | rue: The problem is I don't understand it :-) |
| 16:28:39 | defn52 leaves the room. | |
| 16:30:23 | cabo`` | mae: STRING_P is defined in cpu_primitives.c:56:#define STRING_P(obj) (RISA(obj, string)) |
| 16:31:06 | cabo`` | The problem is that the predicate only makes sense in a specific state, as that's where the globals live, and you can only find out whether something is a string by comparing its klass with the global String |
| 16:31:46 | cabo`` | mae: I don't think it would be wise to limit ourselves to C99 |
| 16:31:56 | cabo`` | And yes, FIXNUM is not a reference. |
| 16:36:41 | cabo`` | as are the other immediates: SYMBOL and the four specials (nil/fals/true/undef) |
| 16:36:47 | cabo`` | everything else is a reference |
| 16:37:12 | cabo`` | rue: Maybe you want to write this up in your IRC summary, so that at some point it goes into the Wiki... |
| 16:38:59 | rue | About the references and such, sure |
| 16:39:39 | rue | cabo``, oh and throw in a paired Array instead of a Hash for extra hilarity |
| 16:41:17 | rue | cabo``, but otherwise it is very simple. The actual value passed in is an Array (basically pairs) in all cases. The first two automatically splat it like normal multiassignment. The *o just gathers all arguments into an Array--and the only argument is an Array pair |
| 16:41:21 | mae | cabo why is Qundef -- 6L |
| 16:41:28 | mae | i would think it would be 8L if your trying to do bits |
| 16:41:54 | boyscout | mae * [664] /rubinius/trunk (runtime/compiler.rba shotgun/lib/cpu_primitives.c shotgun/lib/primitives.rb) more code cleanup -- test it! |
| 16:42:20 | rue | cabo``, the difference between #each and #select is that #select /uses/ #each through Enumerable and has already unpacked the Array when it sends it to your block |
| 16:42:27 | cabo`` | mae: The only important things: |
| 16:42:40 | cabo`` | The four specials are < 10 (see REFERENCE_P) |
| 16:42:48 | cabo`` | and they are even (see FIXNUM_P) |
| 16:42:55 | mae | k |
| 16:43:09 | cabo`` | rue: OK, it had to be something like this |
| 16:43:41 | cabo`` | but how do we get the same behavior in rubinius? |
| 16:44:22 | cabo`` | (BTW, I just compiled Rubinius with a completely different object representation, just to make sure the code is actually representation-oblivious) |
| 16:44:42 | cabo`` | state.h and symbol.c need to be fixed just a bit, the rest already is |
| 16:44:59 | cabo`` | running a few more tests, though |
| 16:55:07 | rue | cabo``, http://pastie.caboo.se/37715 |
| 16:59:21 | cabo`` | rue: Thanks, I'm starting to build a mental model... |
| 17:02:29 | rue | cabo``, added a couple at the bottom |
| 17:04:24 | cabo`` | rue: Apparently, we need more code at the place where a block accepts its arguments. |
| 17:04:37 | rue | Few more for good measure |
| 17:05:41 | cabo`` | This is insane. |
| 17:05:45 | rue | So: A) multiple parameters are always treated as separate B) Arrays will always use multiple assignment semantics when the block argument list allows that |
| 17:06:14 | rue | And C) if the object responds to #to_ary and multiple assignment is in play, #to_ary gets called |
| 17:06:53 | defn52 | blocks are fun :) |
| 17:06:54 | cabo`` | Yeah, so my hack to turn a single block parameter into an masgn is not it |
| 17:07:02 | rue | Nope |
| 17:07:16 | cabo`` | The logic to call to_ary is gated on the masgn |
| 17:08:09 | cabo`` | But still, turning "yield 1, 2" with |a| into [1,2] requires moving a tuple |
| 17:08:15 | rue | Actually, let us revise B to say only if the Array is the only argument |
| 17:08:18 | cabo`` | So half of the patch is useful. |
| 17:08:27 | cabo`` | rue: Yes. |
| 17:09:20 | defn52 | i also thnk splat needs to be considered on the calling side |
| 17:09:30 | defn52 | yielding side, i mean |
| 17:09:46 | rue | That would be normal method call semantics as far as I understand though |
| 17:10:05 | defn52 | i think it currently breaks the compiler though |
| 17:10:34 | rue | Well that is certainly possible |
| 17:11:23 | defn52 | it only breaks yields |
| 17:11:26 | defn52 | not regular function calls |
| 17:11:36 | defn52 | this might be a result of the masgn hack though |
| 17:11:44 | cabo`` | No |
| 17:11:53 | defn52 | shotgun/rubinius -e 'def test(a,b); p a; end; a = [1,2]; test(*a)' |
| 17:11:54 | cabo`` | That is at the receiving end. |
| 17:12:05 | defn52 | vs |
| 17:12:09 | defn52 | shotgun/rubinius -e 'def test; a = [1,2]; yield *a; end; test {|a| p a}' |
| 17:12:43 | defn52 | shotgun/rubinius -e 'def test; a = [1,2]; yield *[1,2]; end; test {|a| p a}' |
| 17:12:44 | rue | But yield itself has no special processing for its arguments, just the receiving block |
| 17:12:59 | cabo`` | The masgn hack is not capable of breaking process_yield :-) |
| 17:13:07 | defn52 | ok...i was just speculating |
| 17:13:21 | cabo`` | You have to compare process_yield with process_call |
| 17:13:27 | defn52 | ah ok |
| 17:13:32 | rue | cabo``, there is no simple way to step through execution of the Ruby parts of the compiler is there? |
| 17:14:03 | cabo`` | You can run your favorite Ruby debugger on rcc |
| 17:14:06 | zedas leaves the room. | |
| 17:14:28 | rue | Oh, rcc will do it? See, I still have no idea which parts are current and which not :/ |
| 17:14:31 | rue | http://pastie.caboo.se/37718 |
| 17:14:37 | rue | That is what I used last night |
| 17:15:08 | cabo`` | Looks great, but what is it? :-) |
| 17:15:35 | cabo`` | I mean, what is the Ruby code that got you into this |
| 17:15:44 | rue | The compilation process of [[1,2]].each {|a, b| p a, b} |
| 17:15:53 | cabo`` | Aah. |
| 17:16:57 | rue | Then I spent too much time with trying to figure out the label translation because I did not see translate_labels and the label hash was autovivifying. Also it was 6am at that point |
| 17:17:15 | cabo`` | OK, labels actually work fine. |
| 17:17:36 | rue | So today I was going to look at encoding since I did finally figure out the assembly |
| 17:17:58 | cabo`` | Good. Any questions about the encoding? |
| 17:19:57 | rue | Not yet, I did not look at the code though the actual encoding was a bit puzzling. For example -> push_int ([55]) encoded as: "\a\000\000\0007" |
| 17:20:20 | cabo`` | '7' = 0x37 = 55 |
| 17:20:44 | cabo`` | You always have one bytecode, followed by one or two 4-byte MSB first integers. |
| 17:21:05 | cabo`` | So each instruction is 1, 5 or 9 bytes. |
| 17:21:16 | cabo`` | Pretty boring :-) |
| 17:21:33 | cabo`` | The opcode gates whether there are 0, 1, or 2 parameters. |
| 17:21:35 | rue | Oh! I for some reason read the string as already being hex which it obviously is not |
| 17:23:58 | cabo`` | It looks like you are now the resident code generation expert ;-) |
| 17:25:14 | rue | Uh-huh |
| 17:26:40 | rue | Hm. Does rcc use any obsolete parts? |
| 17:26:50 | cabo`` | Like rcompile |
| 17:27:24 | cabo`` | It's essentially rcompile + pretty print |
| 17:30:33 | rue | Well, that might be useful. I will dig around the code some more.. then the flipside of the coin is of course the interpreter |
| 17:31:10 | cabo`` | You cannot do much work at BlockEnvironment#call |
| 17:31:24 | cabo`` | because you don't know whether the block has one or multiple parameters |
| 17:31:44 | rue | Oh yes and reading up on the contexts |
| 17:32:37 | cabo`` | So either you do all the work in the generated code (which I would prefer), or you have to insert some information into the BlockEnvironments create_block creates |
| 17:33:56 | tlockney enters the room. | |
| 17:35:36 | nutrimatt enters the room. | |
| 17:36:10 | rue | Hm |
| 17:36:18 | rue | The sexp seems odd |
| 17:37:00 | rue | |a, b| is [:masgn, [:array, [:lasgn, :a, 2], [:lasgn, :b, 3]], nil, nil] |
| 17:37:13 | cabo`` | Yep. |
| 17:37:23 | cabo`` | Is means we have an assignment, but not the rhs |
| 17:37:24 | rue | |a, *b| is [:masgn, [:array, [:lasgn, :a, 2]], [:lasgn, :b, 3], nil] |
| 17:37:42 | cabo`` | Aha, so [2] is the splat. |
| 17:37:54 | cabo`` | Sounds reasonable looking at process_masgn |
| 17:38:32 | rue | Right so the second lasgn gets shifted to the third position |
| 17:38:45 | cabo`` | Yep. |
| 17:38:59 | cabo`` | [1] is the array of normal parameters. |
| 17:39:02 | cabo`` | [2] is the splat. |
| 17:39:21 | rue | And splat does a cast_array |
| 17:40:10 | cabo`` | I have to look up that insn |
| 17:40:59 | rue | However, I suppose that does not solve our problem yet because it depends on what is actually passed in |
| 17:41:09 | cabo`` | It makes an array if the TOS is a tuple, otherwise it makes a single-array element if it is not |
| 17:41:46 | cabo`` | single-element array, that is |
| 17:42:19 | rue | I am still confused by tuples as sad as that is |
| 17:42:56 | rue | Well, more about where they are getting generated and all that |
| 17:43:18 | cabo`` | Tuples are to arrays what bytearrays are to strings |
| 17:44:39 | cabo`` | Tuples have any number of fields, each of which carries an object |
| 17:44:56 | cabo`` | arrays have essential two fields: a size (@total) and a tuple (@tuple) |
| 17:45:03 | cabo`` | so a tuple is a "naked" array |
| 17:45:21 | cabo`` | It can't grow, as arrays can (be replacing their tuple) |
| 17:49:24 | rue | OK.. so the lasgn maps out to an unshift_tuple, set var, pop |
| 17:50:11 | cabo`` | (in an masgn:) yes |
| 17:53:16 | lopex leaves the room. | |
| 17:53:34 | rue | Right |
| 17:53:54 | lopex enters the room. | |
| 17:56:05 | boyscout | cabo * [665] /rubinius/trunk (include/rubinius.h shotgun/lib/state.h shotgun/lib/symbol.c) Move as much of the representation-dependent constants into rubinius.h |
| 17:56:05 | boyscout | as possible The fact that the main code is representation agnostic can |
| 17:56:05 | boyscout | be tested by setting ALTERNATIVE_REPRESENTATION to 1 in rubinius.h |
| 17:56:05 | boyscout | (but please don't check it in that way...). |
| 17:56:25 | cabo`` | Fewer mystic constants in the code... |
| 17:56:34 | cabo`` | But still a long way to go. |
| 17:57:27 | cabo`` | In file included from cpu_primitives.c:71: |
| 17:57:27 | cabo`` | system_primitives.gen: In function ‘cpu_perform_system_primitive’: |
| 17:57:27 | cabo`` | system_primitives.gen:1505: warning: implicit declaration of function ‘regexp_options’ |
| 17:57:27 | cabo`` | |
| 17:57:38 | cabo`` | Who was that? :-) |
| 17:57:40 | rue | Oh. Is the current_op byte-based? |
| 17:58:05 | rue | In the assembler |
| 17:58:37 | cabo`` | I haven't really studied the assembler, but I would think so. |
| 17:59:22 | rue | Because some operations increment it by 5 or 10 etc. and obviously the labels like 85 and 55 and so on. Have to look into that |
| 17:59:37 | cabo`` | No. |
| 17:59:42 | cabo`` | 5 = 1+4. |
| 17:59:46 | cabo`` | Where is 10??? |
| 18:00:42 | rue | Line 337 |
| 18:00:51 | cabo`` | Oh, right, but that's just 2 ops |
| 18:00:57 | rue | Right |
| 18:01:49 | rue | So 1+4 is one op plus what, the data? Or something completely different |
| 18:02:10 | cabo`` | an immediate integer argument, 4 bytes, MSB first |
| 18:02:22 | cabo`` | insns are 1, 1+4 or 1+4+4 |
| 18:02:27 | cabo`` | hence 1, 5, 9 |
| 18:02:37 | rue | Right, so it is incrementing the current_op by the byte count there |
| 18:02:45 | rue | I think |
| 18:02:49 | cabo`` | Yes, indeed. |
| 18:02:58 | cabo`` | It needs to keep track to fill in the labels. |
| 18:03:10 | rue | So the labels are just byte offsets |
| 18:03:19 | cabo`` | Yes. From the start of the meth |
| 18:03:26 | rue | OK |
| 18:05:15 | rue | So where would be the best place for the logic for the block masgn? The masgn is obviously given to us in the sexp so that is half the struggle. Then we need to identify whether we are being passed a single Array as an argument? |
| 18:05:42 | cabo`` | yes, and that can only happen dynamically |
| 18:05:48 | cabo`` | so we have to generate code to do that |
| 18:08:15 | cabo`` | I think I'll have to call it a day, c u tomorrow |
| 18:08:40 | rue | Yep, bye! |
| 18:08:54 | cabo`` | Good night :-) |
| 18:19:37 | zedas enters the room. | |
| 18:28:36 | nutrimatt leaves the room. | |
| 18:31:47 | cabo`` leaves the room. | |
| 18:48:41 | rue | Away for a bitty |
| 18:48:52 | nicksieger leaves the room. | |
| 18:52:19 | jadams enters the room. | |
| 19:10:06 | srbaker_ enters the room. | |
| 19:10:18 | srbaker_ leaves the room. | |
| 19:11:53 | srbaker leaves the room. | |
| 19:12:51 | srbaker enters the room. | |
| 19:14:31 | srbaker leaves the room. | |
| 19:14:45 | srbaker enters the room. | |
| 19:28:05 | defn52_ leaves the room. | |
| 19:54:16 | mae | hiya |
| 19:57:48 | mae | (1L<<SYMBOL_SHIFT)-1) |
| 19:57:53 | mae | why is the 1L needed |
| 19:58:22 | mae | hwhats wrong with (0L<<SYMBOL_SHIFT) |
| 20:01:20 | lopex leaves the room. | |
| 20:04:35 | rue | 1L != 1 |
| 20:04:50 | mae | shouldn't this work |
| 20:04:50 | mae | shotgun/rubinius -e "Ruby.asm('push 1; push 1;'); Ruby.primitive(:compare);" |
| 20:06:35 | rue | It seems likely that that misses something crucial |
| 20:06:49 | rue | What does the asm from 1 <=> 1 look like? |
| 20:07:51 | mae | how do i find out |
| 20:08:29 | rue | What does compare correspond to? |
| 20:08:38 | rue | DEBUG_ASSEMBLER=y and -dc |
| 20:09:58 | mae | push 1 |
| 20:09:58 | mae | push 1 |
| 20:09:58 | mae | send <=> 1 |
| 20:09:58 | mae | ret |
| 20:11:14 | mae | "#line 1\npush 1\npush 1\nsend <=> 1\nret\n" |
| 20:15:32 | mae | rue: i have a need to invoke the primitive directly |
| 20:19:50 | mae | where do primitives get called |
| 20:20:06 | mae | i mean in the bytecode |
| 20:20:07 | mae | how rather |
| 20:26:23 | rue | Why do you need to call it directly? |
| 20:28:33 | mae | is cpu_instructions.c deprecated by instructions.c? |
| 20:28:45 | mae | rue: i'm going to create a why to unit test the behavior of the primitives |
| 20:28:53 | mae | so the primitives behavior is defined better |
| 20:28:57 | mae | and tested better |
| 20:30:27 | mae | send_primitive |
| 20:30:56 | mae | compare is 4 |
| 20:34:30 | mae | DEBUG_ASSEMBLER=y shotgun/rubinius -dc -e "Ruby.asm 'push 1\npush 1\npush 4\nsend_primitive'" |
| 20:39:37 | mae | whats the different between native/bytecode and lib/bytecode |
| 20:43:46 | mae | DEBUG_ASSEMBLER=y shotgun/rubinius -dc -e "Ruby.asm 'push 1\npush 1\nsend_primitive :compare'" |
| 20:50:26 | zedas leaves the room. | |
| 20:50:39 | rue | native/bytecode only has one file. Never found out why those are split |
| 20:51:55 | mae | what am i doing wrong |
| 20:51:57 | mae | http://pastie.caboo.se/37758 |
| 20:52:13 | mae | No method 'strip' on an instance of Fixnum. (NoMethodError) |
| 20:55:45 | hurdlea enters the room. | |
| 21:03:53 | mae | http://pastie.caboo.se/37760 |
| 21:11:17 | nicksieger enters the room. | |
| 21:11:33 | zedas enters the room. | |
| 21:14:27 | mae | hey zed |
| 21:21:45 | defn52_ enters the room. | |
| 21:30:21 | mae | OH DUH |
| 21:30:26 | mae | the compiler is borked |
| 21:35:24 | mae | i'll fix it |
| 21:38:52 | boyscout | mae * [666] /rubinius/trunk (lib/bytecode/compiler.rb runtime/compiler.rba shotgun/lib/cpu_primitives.c) def ivars; Ruby.asm "push self\npush 0\nfetch_field"; end |
| 21:38:52 | boyscout | now compiles on rubinius (rather than having to use rcompile) |
| 21:38:52 | boyscout | fixed primitive error message to be more helpful |
| 21:58:13 | rue | Think there was a Ruby.primitive too |
| 21:58:34 | mae | yep |
| 21:58:52 | mae | what i really need to be able to do is manipulate with asm |
| 21:59:02 | mae | so i can change context without writing tons of boilerplate ruby |
| 22:00:15 | mae | hmm |
| 22:00:22 | mae | it seems asm doesn't work in the compiler ? |
| 22:02:26 | mae | No method 'asm' on an instance of Module. (NoMethodError) |
| 22:02:28 | mae | wtf |
| 22:02:32 | mae | i thought this was a compiler directive |
| 22:05:26 | mae | i wish evan was around |
| 22:28:59 | hookET enters the room. | |
| 22:43:10 | boyscout | mae * [667] /rubinius/trunk (lib/bytecode/compiler.rb runtime/compiler.rba) fixed regression -- should be best of both worlds now |
| 22:46:27 | hurdlea leaves the room. | |
| 22:50:08 | defn52_ leaves the room. | |
| 22:50:19 | rue | Hm, I wonder if the second parameter to str is used anywhere |
| 22:50:58 | mae | wtf is that for |
| 22:51:00 | mae | anyways |
| 22:51:38 | mae | um |
| 22:52:56 | rue | Why are you trying to isolate the primitives? |
| 22:53:52 | mae | to test them |
| 22:53:56 | mae | like i said before |
| 22:58:25 | defn52_ enters the room. | |
| 23:00:12 | jadams leaves the room. | |
| 23:17:55 | rue | But is it necessary to test them outside the user-reachable methods? |
| 23:25:03 | mae | rue: if i want to automate it then i have to be able to modify the context easy |
| 23:25:15 | mae | so its either this (small amount of code) or i have to generate all kinds of class structures etc |
| 23:25:40 | mae | primitives only know that they have to process some stuff sitting on the stack |
| 23:34:40 | hookET leaves the room. | |
| 23:46:02 | mae | messing with rubinius asm is fun :) |
| 23:52:08 | mae | i just thought of a problem :\ |