Show enters and exits. Hide enters and exits.
| 00:35:39 | evan | so |
| 00:35:52 | evan | I'm going to take a swing at prelim windows support for 1.1 I think. |
| 01:03:50 | philo | allo |
| 01:08:38 | brixen | hi jasper586 |
| 01:08:55 | jasper586 | not much talk here |
| 01:09:13 | brixen | actually depends on the time of day |
| 01:09:19 | brixen | want to chat about something? |
| 01:12:10 | jasper586 | not really was just curious about the state of rubinius |
| 01:12:18 | jasper586 | and the website seems a litle outdated |
| 01:12:46 | brixen | yes, sorry, it is |
| 01:12:58 | brixen | we are so not good at website |
| 01:13:07 | brixen | what question do you have? |
| 01:15:27 | brixen | jasper586: are you a ruby programmer? |
| 01:15:42 | jasper586 | minor rubyist |
| 01:15:47 | brixen | cool |
| 01:15:49 | jasper586 | more interrested in llvm |
| 01:15:59 | brixen | have you tried running your ruby codes one rubinius? |
| 01:16:11 | brixen | er s/one/on/ |
| 01:16:12 | jasper586 | nope i use jruby |
| 01:16:20 | brixen | ok |
| 01:16:46 | brixen | well, any questions in particular? |
| 01:17:09 | jasper586 | just looking for some benchmark |
| 01:17:13 | jasper586 | rubinius vs jruby |
| 01:17:23 | jasper586 | and the current state of the project |
| 01:17:27 | brixen | ok |
| 01:17:33 | brixen | well, you can run the benches yourself |
| 01:17:42 | brixen | there's a number in the benchmark dir |
| 01:17:46 | jasper586 | was planning on lurking here for some time lol |
| 01:18:02 | jasper586 | hummm i am too lazy for that lol |
| 01:18:04 | brixen | but I suggest taking a look at benchmar/tiers |
| 01:18:13 | jasper586 | brizen rubyist or compiler guru ? |
| 01:18:31 | brixen | rubyist, aspiring compiler guru :) |
| 01:18:58 | brixen | current status is we are working on 1.1 release |
| 01:19:15 | brixen | and need feedback from folks about how their code runs |
| 01:19:23 | brixen | evan has been working on removing the GIL |
| 01:19:30 | brixen | you can check that out in the hydra branch |
| 01:19:40 | brixen | may have preliminary windows support in 1.1 |
| 01:19:57 | brixen | other than that, best way to check it out is to run it |
| 01:20:07 | brixen | rvm install rbx-head may be easist for you |
| 01:20:17 | brixen | ar git clone rbx; configure; rake |
| 01:20:32 | brixen | ok, I'm grabbing some dinner |
| 01:20:59 | brixen | jasper586: if you lurk logged in, feel free to leave some questions in channel and I'll answer them when back if I can |
| 01:21:05 | brixen | or someone else will :) |
| 01:21:52 | jasper586 | brixen: thanks |
| 05:39:06 | dbussink | morning :) |
| 05:44:31 | brixen | dbussink: don't you ever sleep? :P |
| 05:48:44 | dbussink | brixen: i have a steady rhythm, not very programmer worthy ;) |
| 14:21:19 | seydar | anyone awake yet? |
| 14:39:24 | dbussink | i am |
| 14:39:37 | dbussink | seydar: for over 9 hours :p |
| 14:39:44 | seydar | http://github.com/bjpop/berp/ |
| 14:40:13 | seydar | there's been talk of garnet for over two years now |
| 14:40:30 | seydar | we could in theory piggy back a ruby face to the berp backend |
| 14:50:08 | seydar | dbussink: what do you think of that for garnet? |
| 14:54:08 | seydar | i'm freaking out. i can't believe someone got a python -> haskell compiler |
| 14:54:20 | seydar | he did it in the same fashion that I'd do |
| 14:54:28 | seydar | but that fact that he did it destroys me |
| 14:54:34 | seydar | and sets a precedent |
| 14:55:30 | seydar | would compiling to Haskell for Garnet be acceptable? or do people really want C/++? |
| 14:56:57 | philo | a python to haskell compiler ? |
| 14:57:01 | philo | are people that bored ? |
| 14:59:39 | seydar | hah. It sets a nice precedent for other people to compile dynamic langauges |
| 15:04:13 | dbussink | seydar: hehe, you will experience that feeling more often in your life ;) |
| 15:04:18 | dbussink | the i wish i'd done that feeling |
| 15:04:50 | seydar | i need to get moving then before technology gets too advanced and everyone gets all the low hanging fruit |
| 15:07:11 | seydar | but seriously. Garnet with a haskell backend. what do people think |
| 15:07:21 | dbussink | seydar: garnet? |
| 15:07:37 | seydar | Ruby (subset) -> machine code |
| 15:07:53 | seydar | something rubinius can be bootstrapped in |
| 15:08:10 | seydar | although it wouldn't quite be boostrapping, but you get my point |
| 15:08:22 | dbussink | seydar: hehe, didn't know that idea had that name |
| 15:08:44 | philo | seydar doesnt that kill the all point ? |
| 15:08:58 | bougyman | so how do I install gems into rbx? |
| 15:09:07 | bougyman | i notice it doesn't have a 'gem' binary. |
| 15:09:16 | dbussink | bougyman: ./bin/rbx -S gem install whatever_gem |
| 15:09:20 | bougyman | http://github.com/evanphx/rubinius/tree/master/doc/ nothing here gets me quickly there. |
| 15:09:24 | bougyman | dbussink: cool, thanks. |
| 15:09:32 | seydar | we should update the docs |
| 15:09:53 | seydar | i can't do that now, but i can do it in like 9 hours or so |
| 15:10:08 | dbussink | if you can chat here, you can do it too ;) |
| 15:10:12 | seydar | philo: rbx needs to be written in something that compiles to machine code |
| 15:10:16 | bougyman | dbussink: are y'all opposed to a wrapper in bin/ named gem which calls that? |
| 15:10:48 | dbussink | bougyman: dunno about that, but the -S way of doing things is actually something that works across all rubies |
| 15:11:08 | dbussink | bougyman: jruby -S rake whatever runs the whatever rake task in jruby |
| 15:11:09 | bougyman | brave man. |
| 15:11:14 | bougyman | i don't even know what 'all rubies' are. |
| 15:11:15 | seydar | philo: right now that lingo is C++, because it compiles to machine code |
| 15:11:18 | philo | seydar: dont know much about rubinius , but what dpes rbx do ? loading gems ? |
| 15:11:24 | dbussink | bougyman: jruby, rbx, mri |
| 15:11:27 | bougyman | i wouldn't dare to say they all do something the same :) |
| 15:11:28 | seydar | philo: rbx is the shortname for rubinius |
| 15:11:59 | philo | you want to rewrite the base in haskell ? |
| 15:12:00 | dbussink | bougyman: well, they usually support the -S style of executing bin scripts |
| 15:12:04 | seydar | philo: garnet would be the name for some ruby-like language that (eventually) compiles to machine code |
| 15:12:21 | dbussink | rvm also supports it to call it for all rubies it will call |
| 15:12:23 | bougyman | ugh. |
| 15:12:28 | seydar | philo: heh, i've toyed with the idea, but not quite. I want to write the ruby-like language in haskell |
| 15:12:29 | bougyman | hit a giant problem. |
| 15:12:38 | seydar | philo: or rather, have it compile to haskell |
| 15:12:40 | bougyman | Kernel(NilClass)#to_str (method_missing) at kernel/delta/kernel.rb:85 |
| 15:12:48 | philo | i see |
| 15:12:55 | seydar | philo: and from there, compile the haskell code to machine code |
| 15:13:02 | philo | interresting |
| 15:13:02 | dbussink | bougyman: do you have a backtrace? |
| 15:13:14 | philo | depend on what exactly is the garnet subset |
| 15:13:17 | bougyman | dbussink: yeah. |
| 15:13:19 | bougyman | but hold on |
| 15:13:33 | seydar | philo: yeah. how strict do we make it? what features do we include? |
| 15:13:35 | bougyman | even when I add to_s to NilClass it throws it. |
| 15:13:52 | seydar | open ended question. i get the feeling that it's just a "make SOMETHING" kind of game |
| 15:14:06 | bougyman | can I bring pastr in here for a sec for the backtrace? |
| 15:14:07 | dbussink | well, to_s != to_str :) |
| 15:14:12 | philo | seydar ? |
| 15:14:25 | dbussink | bougyman: you can also gist or pastie it somewhere |
| 15:14:41 | philo | how much c++ line of code rbx (excluding llvm) of course |
| 15:15:17 | seydar | philo: I'm not sure how many lines of code rbx is. but the idea is to rewrite it all in garnet |
| 15:15:34 | Pastr | bougyman pasted http://pastr.it/16853 (rbx backtrace trying to load ramaze app.rb), 103 lines of Plain Text |
| 15:16:03 | seydar | philo: sorry, the idea is to rewrite the C++ parts in garnet |
| 15:16:16 | dbussink | bougyman: what version of rbx are you using? |
| 15:16:31 | dbussink | bougyman: and can you create a small script that reproduces the issue? |
| 15:16:46 | philo | seydar: interresting evenif i dont clearly see the point |
| 15:17:01 | philo | the compiler is allready in ruby right ? |
| 15:17:10 | bougyman | dbussink: yes, loading innate does it. |
| 15:17:20 | dbussink | bougyman: that's a gem? |
| 15:17:21 | bougyman | dbussink: i probably updated git mid-last week. |
| 15:17:23 | bougyman | dbussink: yes. |
| 15:17:31 | seydar | philo: the core of the compiler is in C++. The point is to rewrite it in something that looks like Ruby |
| 15:17:37 | bougyman | innate is the base of ramaze |
| 15:17:56 | seydar | bougyman: since i don't have access to rbx right now, can you run `nil.to_s` for me? |
| 15:18:10 | seydar | bougyman: and then `nil.to_str`? |
| 15:18:13 | bougyman | seydar: sure, one sec, getting the latest git. |
| 15:18:38 | bougyman | irb(main):002:0> nil.to_str |
| 15:18:38 | bougyman | NoMethodError: no method 'to_str' on nil:NilClass. |
| 15:18:49 | seydar | nil.to_s |
| 15:18:53 | seydar | what does that return |
| 15:18:56 | philo | seydar: ok i thought the vm was in c++ and the compiler in ruby |
| 15:19:03 | bougyman | seydar: "" |
| 15:19:12 | seydar | philo: ah, yes. thank you for correcting my terminology |
| 15:19:14 | bougyman | i did class NilClass;def to_str;to_s;end;end to get by that one. |
| 15:19:28 | seydar | philo: the vm is in c++, and the goal is to rewrite the VM in garnet, or something ruby-like |
| 15:19:42 | bougyman | uh oh. |
| 15:19:48 | bougyman | i've got some 1.9.1 stuff in this app. |
| 15:19:55 | bougyman | from Kernel(Object)#require_relative (method_missing) at kernel/delta/kernel.rb:85 |
| 15:20:04 | bougyman | does rbx not support any 1.9isms? |
| 15:20:08 | philo | seydar: ok i understand now , but dont really see the point |
| 15:20:11 | seydar | bougyman: your error looks like a ramaze error. try just running it again |
| 15:20:24 | philo | seydar: is someone working on the definition of the garnet subset ? |
| 15:20:25 | dbussink | seydar: you mean that's the goal for rbx? |
| 15:20:30 | seydar | philo: just to unify the language that rbx is written in |
| 15:20:59 | seydar | dbussink: i was just referring to garnet, the strict ruby subset that compiles natively |
| 15:21:25 | dbussink | seydar: well, it's not a very immediate goal, more of a nice to have future i guess :) |
| 15:21:46 | bougyman | seydar: which, the nil.to_str? |
| 15:21:47 | seydar | yeah, a goal for a long time from now |
| 15:21:52 | philo | why not use rbx compiler to compiler to llvm bytecode then llvm to compile to native code ? |
| 15:21:53 | bougyman | that happens in just rbx<enter> irb. |
| 15:21:59 | seydar | bougyman: yeah. that's correct behavior. |
| 15:22:11 | seydar | bougyman: but you got that error in your pastr.it thing |
| 15:22:13 | bougyman | what is nil.to_str being undefined? |
| 15:22:27 | seydar | bougyman: just try rerunning your ramaze app |
| 15:22:53 | bougyman | seydar: same error. |
| 15:23:04 | bougyman | it's not just gonna go away without changing something |
| 15:23:05 | dbussink | bougyman: nil.to_str is also not defined in 1.9 |
| 15:23:19 | bougyman | i can get by that error by defining nil.to_str, but yeah, i see what you mean. |
| 15:23:40 | dbussink | bougyman: so this a problem that appears as this, but it's not the issue in itself |
| 15:25:31 | seydar | bougyman: actually sometimes those pesky nil errors do |
| 15:29:18 | bougyman | oh crap. |
| 15:30:03 | bougyman | now i'm hitting {the: "new", literal: "Hash notation"} missing. |
| 15:30:12 | bougyman | no fix for that, i'd have to change code. |
| 15:31:29 | bougyman | getting further now. |
| 15:39:49 | bougyman | very odd now. |
| 15:41:32 | bougyman | it's kind of crazy behavior... same app, same code, 1.8.7 and 1.9.1 work fine, rbx gives a Sequel::DatabaseConnectionError: PGError: could not translate host name "nrs_ic" to address: Name or service not known |
| 15:41:40 | bougyman | i have no idea where it's getting/setting that hostname. |
| 15:42:39 | bougyman | jeremyevans: around? |
| 15:45:56 | seydar | bougyman: that is weird |
| 16:02:04 | jeremyevans | bougyman: I'm around |
| 16:03:29 | bougyman | jeremyevans: ever seen the above? |
| 16:03:41 | bougyman | nrs_ic is the database name, the host is localhost. |
| 16:03:45 | bougyman | but i'm specifying that. |
| 16:03:55 | jeremyevans | bougyman: Can you pastie the code you have and the backtrace? |
| 16:08:30 | bougyman | jeremyevans: sure, when I get back to the office. |
| 16:08:54 | bougyman | i'm out for beers atm, it's been a hell week (a/c has gone out in the dc twice and our avaya definity lost its brain) |
| 16:17:35 | evan | morning gents. |
| 16:17:39 | evan | busy in here this morning! |
| 16:18:04 | seydar | morning 'van |
| 16:18:11 | seydar | have you read the backlog? |
| 16:18:25 | seydar | and at my place of work, they have a shittonne of beer in the fridge. is this normal? |
| 16:20:48 | bougyman | seydar: it is in our branch office, not at corporate. |
| 16:21:00 | bougyman | plus I like to get out of the office for a while. |
| 16:21:05 | bougyman | especially in a week like this. |
| 16:21:14 | bougyman | 1.8 million dollar phone switch bit the dust. |
| 16:29:51 | evan | just got done reading the backlog |
| 16:32:25 | evan | bougyman: wrt your nil error |
| 16:32:37 | bougyman | yeah i'm way past that |
| 16:32:41 | evan | i wonder if perhaps you're using File.dirname(__FILE__) inside an instance_eval |
| 16:32:44 | bougyman | on a weird sequel-related one now. |
| 16:32:45 | evan | but did you actually fix it? |
| 16:33:03 | bougyman | evan: it disappeared, dunno about 'fixed' |
| 16:33:07 | bougyman | i can load ramaze apps now. |
| 16:33:14 | bougyman | i questioned that, too, seydar said: just try it again. |
| 16:33:20 | bougyman | i was skeptical, but it somehow worked. |
| 16:33:42 | evan | seydar: why did you think running it again would help? |
| 16:33:55 | seydar | because i've seen nil errors that just kinda come and go before |
| 16:33:58 | bougyman | now... in the meantime I found gem install extensions and added require "extensions/all" so my require_relative usage wasn't affected. |
| 16:34:15 | bougyman | i did get rid of all my hash-literal notation, i'm gonna have to get out of that habit for rbx, eh? |
| 16:34:19 | seydar | evan: precedent, not any logic |
| 16:34:20 | bougyman | i was so loving it in 1.9 |
| 16:34:53 | bougyman | require_relative, hash literal notation, and fibers were the main reasons I liked 1.9 |
| 16:35:07 | evan | precedent? :/ |
| 16:35:13 | evan | thats a terrible precedent to set. |
| 16:35:35 | seydar | the precedent was that I've seen nils happen before |
| 16:35:44 | evan | bougyman: yeah, we don't have any 1.9isms. |
| 16:35:55 | evan | i haven't. |
| 16:36:04 | evan | it's important to get to the bottom of those |
| 16:36:09 | seydar | i don't like fixing bugs in that fashion, but at least it identifies the bug as semi-non-deterministic |
| 16:36:12 | evan | not just rerun it again and shrug. |
| 16:36:23 | seydar | we're not shruggin (yet) |
| 16:36:27 | evan | it doesn't identify the bug at all |
| 16:36:33 | seydar | but how can we solve it if we can't reliably reproduce the bug? |
| 16:36:34 | evan | unless you actually do something about it |
| 16:36:45 | evan | you try and make it reliable |
| 16:36:50 | evan | ie, remove the .rbc file |
| 16:36:53 | evan | see if it happens again. |
| 16:37:09 | seydar | good thinking |
| 16:37:10 | evan | thats the only thing that changes between runs. |
| 16:37:38 | bougyman | i didn't know shit about an .rbc |
| 16:37:47 | bougyman | i sisn't know I was using python now |
| 16:37:50 | bougyman | ducks |
| 16:37:52 | seydar | bougyman: rm app.rbc |
| 16:38:07 | evan | bougyman: :/ |
| 16:38:38 | bougyman | lisp does it, too, just kidding y'know. |
| 16:38:46 | bougyman | i'll try and see if I can get it again. |
| 16:40:43 | evan | k |
| 16:41:29 | seydar | bougyman: what's the word! duplicated? |
| 16:41:51 | bougyman | the word is beer |
| 16:41:55 | bougyman | i'm still at lunch. |
| 16:42:41 | seydar | LUNCH?! |
| 16:42:49 | jeremyevans | evan: Did you have a chance to look at the patch I sent yesterday for rb_str_set_len? |
| 16:43:02 | evan | nope. |
| 16:43:39 | jeremyevans | evan: http://pastie.org/1089381.txt |
| 16:43:52 | jeremyevans | evan: I'm not sure if it's correct, though it does make the spec pass |
| 16:44:00 | bougyman | is there a facility or utility built in to rbx to do the equiv of bougyman@zero:~/g/nrs_ic$ find . -name "*.rbc" -exec rm {} \; |
| 16:44:04 | bougyman | ? |
| 16:44:24 | evan | find . -name "*.rbc" -delete |
| 16:44:28 | bougyman | yes, duplicated. |
| 16:44:28 | jeremyevans | evan: Does string->num_bytes(state, len) increase the size of the buffer if it is bigger then the current size? |
| 16:44:29 | evan | btw. |
| 16:44:39 | evan | jeremyevans: no. |
| 16:44:58 | evan | it simply sets the virtual size |
| 16:45:19 | jeremyevans | evan: Then it probably isn't right. I think that string->data()->size() might not be right then |
| 16:45:38 | bougyman | evan: oh neat, i don't man find much these days cause it screws me up on solaris and aix, i don't think either of them would accept that. |
| 16:45:38 | evan | well, thats the size of the backing buffer. |
| 16:45:44 | bougyman | i'll be very happy when our aix boxes are gone. |
| 16:45:45 | jeremyevans | evan: Because moving it out of the if statement fixes the spec, even though it should take the if branch |
| 16:45:57 | evan | well, moving it out is wrong. |
| 16:46:39 | seydar | goes to lunch |
| 16:46:43 | jeremyevans | evan: It's interesting that it doesn't take the if branch if the len is more than 4, since the buffer size should be at least 128 |
| 16:46:56 | evan | you need to figure out why that is. |
| 16:47:10 | jeremyevans | evan: I'll give it a shot :) |
| 16:47:11 | bougyman | evan: you want the code that made this error (it's a small ramaze/sequel tree)? |
| 16:47:26 | evan | bougyman: i'd prefer if you could isolate it |
| 16:47:40 | bougyman | evan: will do |
| 16:47:44 | evan | since i'll have to do it if you don't. |
| 16:48:22 | bougyman | manveru will likely help, i'll get it to you as soon as I can isolate |
| 16:49:45 | nooga | hey |
| 16:49:55 | nooga | i'm having problems with compiling |
| 16:49:57 | nooga | melbourne.so: [BUG] Segmentation fault |
| 16:50:36 | evan | nooga: thats under 1.8 I'm assuming? |
| 16:50:38 | nooga | rbx exec is ready in bin/ but i can't run it because of Runtime exception: Unable to load /home/nooga/ruby/rubinius/runtime/platform.conf, it is missing |
| 16:50:53 | nooga | evan: yes, 1.8.7, i failes for other reasons under 1.9.1 |
| 16:50:55 | evan | nooga: please provide more context to getting that. |
| 16:51:00 | nooga | failed* |
| 16:51:03 | evan | ie |
| 16:51:06 | nooga | okay, sec |
| 16:51:09 | evan | what command you were running |
| 16:51:21 | evan | a terminal backtrace |
| 16:51:24 | evan | something. |
| 16:52:31 | nooga | https://gist.github.com/26c234f1002d2d2d427f |
| 16:52:33 | nooga | here |
| 16:52:56 | evan | ... |
| 16:53:03 | evan | rvm has likely completely confused things |
| 16:53:06 | evan | run 'rake distclean' |
| 16:53:07 | evan | and try again. |
| 16:53:53 | nooga | under the same rvm state ? |
| 16:54:00 | evan | yeah |
| 16:54:17 | evan | you could also use rvm to build rubinius |
| 16:57:32 | nooga | trued |
| 16:57:34 | nooga | it fails :D |
| 16:57:37 | nooga | tried* |
| 16:58:01 | evan | well then |
| 16:58:04 | evan | you've got other problem.s |
| 16:58:51 | jeremyevans | evan: string->data()->size() is always 4 according to some printf debugging |
| 16:59:05 | evan | .... |
| 16:59:23 | evan | how are you creating the string passed to set_len? |
| 16:59:31 | jeremyevans | evan: rb_str_buf_new |
| 16:59:40 | evan | it must be broken. |
| 16:59:43 | jeremyevans | evan: I don't modify that function :) |
| 16:59:59 | dbussink | evan: you can't compile rbx with an rvm ruby version active in general |
| 17:00:06 | brixen | jeremyevans: do you have a spec that illustrates the expected behavior? |
| 17:00:15 | nooga | ha |
| 17:00:22 | dbussink | evan: because it will link melbourne against the system ruby version and loads it in the rvm version then |
| 17:00:25 | nooga | evan: it seems that everything is okay now |
| 17:00:28 | jeremyevans | brixen: Yes http://pastie.org/1089312.txt |
| 17:00:39 | evan | dbussink: ah ok. |
| 17:00:46 | jeremyevans | brixen: It's just a stroke of luck that the spec caught it |
| 17:01:21 | brixen | jeremyevans: let's do one c-api function per describe |
| 17:01:22 | jeremyevans | evan: Nothing jumps out to me as obviously wrong in rb_str_buf_new |
| 17:01:30 | brixen | I'll take a look |
| 17:01:38 | jeremyevans | brixen: It's very hard to test rb_str_buf_new in isolation |
| 17:01:44 | jeremyevans | brixen: You'll always get the empty string |
| 17:02:02 | jeremyevans | brixen: It only makes sense in conjunction with rb_str_set_len |
| 17:02:07 | brixen | I'm not saying you need to try it in isolation |
| 17:02:58 | jeremyevans | brixen: So you just want the description changed, even though it tests both? |
| 17:03:16 | brixen | I'm applying and working with your patch now |
| 17:03:18 | brixen | give me a second |
| 17:04:03 | nooga | that's strange |
| 17:04:32 | nooga | after rake distclean && rake everything runs smoothl |
| 17:04:34 | nooga | y |
| 17:05:23 | evan | nooga: not really |
| 17:05:29 | evan | nooga: you had artifacts from a previous compile |
| 17:05:40 | evan | specificly an extension compiled against another version of MRI |
| 17:08:21 | nooga | haaa, rubinius haven't got `->' sugar for lambda :C |
| 17:08:50 | evan | course not. |
| 17:08:52 | evan | it's not 1.9 |
| 17:11:35 | bougyman | that's one I never liked. |
| 17:11:40 | evan | ditto. |
| 17:14:36 | jeremyevans | evan: brixen I'm a C++ newb, but perhaps rb_str_buf_new should be using create_pinned or create_reserved? Not sure what the difference is between those and create |
| 17:14:53 | evan | no |
| 17:14:55 | evan | it should not. |
| 17:15:05 | brixen | jeremyevans: let me fix the spec first |
| 17:15:10 | jeremyevans | brixen: OK |
| 17:15:27 | evan | actually, it could use create_reserved |
| 17:15:40 | evan | but it's basically the same as create with a Fixnum |
| 17:15:53 | brixen | this will be really easy when we have a real spec |
| 17:15:55 | brixen | promise |
| 17:16:02 | evan | :) |
| 17:16:04 | brixen | I'm looking at the mri code |
| 17:16:05 | jeremyevans | brixen: I believe you :) |
| 17:16:16 | brixen | it's not that hard ™ |
| 17:16:18 | brixen | :) |
| 17:18:14 | brixen | jeremyevans: could you show me the C or Ruby code that illustrated this problem? |
| 17:18:52 | jeremyevans | brixen: Doesn't the spec do that? It passes the first line and fails the second |
| 17:18:57 | brixen | rb_str_buf_new is indistinguishable from String.new |
| 17:19:05 | brixen | it's all implementation details |
| 17:19:18 | brixen | jeremyevans: that spec is completely busted sorry |
| 17:19:36 | jeremyevans | brixen: rb_str_buf_new is a little different. It makes sure there are at least the given number of bytes to write into |
| 17:19:57 | evan | brixen: rb_str_buf_new reserves the space and sets the virtual size to 0 |
| 17:20:01 | jeremyevans | brixen: Basic idea is in that spec. |
| 17:20:02 | evan | it's not a blank fill. |
| 17:20:08 | brixen | yes, I know what it does |
| 17:20:11 | evan | ok |
| 17:20:15 | evan | just checking! |
| 17:20:16 | brixen | that's not the point |
| 17:20:30 | brixen | I'm trying to understand where it was actually used |
| 17:20:31 | jeremyevans | brixen: I'm not sure how it's busted, since it works in ruby 1.8 and 1.9 :) |
| 17:20:51 | brixen | jeremyevans: do you have app code or not? |
| 17:21:09 | jeremyevans | brixen: I've seen the technique in a few ruby extensions, and I'm using it in my own extension for all string creation |
| 17:21:20 | brixen | ok, could you point me to that? |
| 17:21:36 | brixen | I actually don't know what your code is :) |
| 17:21:53 | jeremyevans | brixen: I haven't yet published it, but let me pastie a typical function |
| 17:21:58 | brixen | o |
| 17:21:59 | brixen | k |
| 17:23:29 | jeremyevans | brixen: http://pastie.org/1090768.txt |
| 17:23:56 | jeremyevans | brixen: The reason for using it is that avoids a copy (in MRI) |
| 17:24:24 | brixen | um... |
| 17:24:32 | brixen | ok |
| 17:24:34 | jeremyevans | brixen: the alternative is writing into your own C buffer, and creating a ruby string copy from that |
| 17:24:40 | brixen | yes |
| 17:30:45 | jeremyevans | evan: brixen: Found the problem |
| 17:31:02 | evan | and? |
| 17:31:18 | jeremyevans | In rb_str_buf_new, calling str->num_bytes with a 0 length shrinks the buffer size to 4 |
| 17:31:31 | evan | it fucking better not. |
| 17:31:35 | thelinuxlich | hmm ruby-oci8 gem doesn't install on rbx-head |
| 17:31:36 | jeremyevans | Sorry, just me being stupid |
| 17:31:44 | jeremyevans | can't read my own debug output |
| 17:32:13 | evan | thelinuxlich: ok, file a ticket. |
| 17:32:14 | jeremyevans | As best as I can see, somewhere between buf_new and set_len, the buffer size shrinks |
| 17:32:37 | evan | oh, i'll bet I know. |
| 17:32:50 | evan | the capi handle is caching info about the string |
| 17:33:07 | evan | and confusing it. |
| 17:33:46 | jeremyevans | evan: That makes sense to me. Is the fix just to stop caching? |
| 17:33:53 | evan | nope. |
| 17:33:56 | evan | we must cache. |
| 17:34:06 | evan | because we have to expose a RString* |
| 17:34:32 | jeremyevans | evan: So we'd have to update the handle when the C++ object changed? |
| 17:34:51 | thelinuxlich | evan, done :) |
| 17:35:05 | evan | jeremyevans: yeah, i need to think about what order to do this in. |
| 17:35:08 | evan | so we don't loose the change. |
| 17:35:23 | jeremyevans | evan: Would a workaround be getting a new handle? |
| 17:35:27 | evan | nope |
| 17:35:32 | evan | thats completely invalid |
| 17:35:35 | evan | one handle, one object. |
| 17:36:14 | jeremyevans | evan: OK. |
| 17:37:42 | brixen | rb_str_set_len is an incredibly unsafe function |
| 17:37:53 | brixen | I can't believe it exists actually |
| 17:38:00 | jeremyevans | brixen: It's safe if used as designed :) |
| 17:38:03 | brixen | it does no bounds checks |
| 17:38:13 | brixen | jeremyevans: yeah, sure |
| 17:38:30 | jeremyevans | brixen: My original implementation used rb_str_resize |
| 17:38:49 | jeremyevans | brixen: But it didn't work on 1.9, and the ruby developers told me to use rb_str_set_len |
| 17:39:11 | brixen | jeremyevans: honestly, I'm surprised you're not doing this all in asm ;) |
| 17:39:57 | jeremyevans | brixen: The benefits are great, especially on 1.8: over 200x improvement in some functions |
| 17:40:03 | brixen | the point is, memcpy is incredibly fast |
| 17:40:26 | brixen | writing to your own buf and calling rb_str_new variant is the way to write portable code |
| 17:40:50 | brixen | but since MRI's functions just hang out, that's not an often-used approach |
| 17:40:52 | jeremyevans | brixen: This will be portable once rbx supports it :) |
| 17:41:14 | brixen | jeremyevans: the issue is these functions have no semantics in Ruby code |
| 17:41:18 | jeremyevans | brixen: And it's a technique used in other ruby libraries and encouraged by ruby-core, so rbx should support it |
| 17:41:30 | brixen | so writing reasonable, non-confounded specs for them is hard |
| 17:41:44 | brixen | jeremyevans: I'm not arguing about support |
| 17:41:57 | brixen | but don't tell me that "the way it's done in MRI" is good software engineering |
| 17:42:07 | brixen | that will just make me glare at you :) |
| 17:42:44 | jeremyevans | brixen: Point taken |
| 17:43:31 | jeremyevans | brixen: I didn't say it was good software engineering. However, I believe my use of it is safe. |
| 17:43:51 | brixen | probably is |
| 17:45:18 | evan | brixen: it's safe enough, we can bounds check that the size doesn't exceed the backing storage |
| 17:45:30 | brixen | ours would, of course |
| 17:45:36 | brixen | MRI's does not |
| 17:45:58 | evan | right. |
| 17:45:58 | jeremyevans | brixen: I think it does now, with the if block in set_len |
| 17:46:15 | brixen | now == ? |
| 17:46:21 | brixen | I'm looking at 1.8.7 code |
| 17:46:22 | evan | rb_str_set_len, Caveat emptor. |
| 17:46:42 | jeremyevans | brixen: now meaning in rbx |
| 17:46:51 | brixen | I'm not there yet |
| 17:46:58 | brixen | still writing these specs |
| 17:56:59 | evan | so confusing. |
| 17:57:03 | evan | 2 CompiledMethods |
| 17:57:11 | evan | for the same method in source |
| 17:57:21 | brixen | huh? |
| 17:57:25 | evan | both mature (so one isn't a pre GC version of the other) |
| 17:57:33 | brixen | oh, in hydra? |
| 17:57:37 | evan | yea |
| 17:57:39 | brixen | hmm |
| 17:59:52 | brixen | and fun, rb_str_set_len is a 1.8.7+ function |
| 18:00:04 | jeremyevans | brixen: Yep. I still use rb_str_resize on 1.8.6 |
| 18:00:11 | brixen | ok, tire fixed, I have to go for a bit |
| 18:00:29 | jeremyevans | brixen: I think rb_str_resize works on 1.8.7, but on 1.9 due to internal changes |
| 18:00:55 | brixen | sounds like a bug in MRI to me |
| 18:00:58 | brixen | bbiab... |
| 18:01:24 | jeremyevans | brixen: I reported it as a bug, with a one character fix that worked for me. They rejected it |
| 18:06:11 | seydar | hah why? |
| 18:06:37 | jeremyevans | seydar: It may cause problems I guess. They didn't go into detail |
| 18:07:17 | jeremyevans | seydar: http://redmine.ruby-lang.org/issues/show/3652 |
| 18:08:37 | evan | looks like they did apply your change. |
| 18:08:45 | jeremyevans | evan: and then reverted it |
| 18:09:08 | evan | :/ |
| 18:09:28 | jeremyevans | And they may be right that it causes problems in some cases |
| 18:09:39 | jeremyevans | I don't know enough to say that it does not |
| 18:19:15 | brixen | arg, man |
| 18:19:30 | brixen | yui is changing capi specs without even reading the spec |
| 18:21:59 | evan | changing specs without reading the spec thats being changed? |
| 18:22:41 | brixen | ugh ugh |
| 18:22:50 | brixen | sigh |
| 18:23:41 | seydar | yo dude... if you want... i know a guy... |
| 18:28:07 | evan | OO_OO |
| 18:28:28 | evan | I might know the issue, though it's confusing. |
| 18:28:39 | evan | my using of InlineCaches isn't thread safe. |
| 18:28:43 | evan | usage. |
| 18:38:04 | seydar | what is it you do to make InlineCaches threadsafe? |
| 18:40:48 | brixen | you apply ScotchGuard so the threads don't get frayed |
| 18:48:25 | seydar | ah, thank you master brixen for enlightening me |
| 18:54:37 | brixen | seydar: anytime, and I mean, anytime, for you sir |
| 18:55:26 | seydar | we should go to a conference together and both where suits |
| 18:55:38 | brixen | that is an excellent idea |
| 18:55:41 | brixen | I like suits |
| 18:55:45 | seydar | me too |
| 18:55:48 | brixen | the clothing that is |
| 18:56:01 | seydar | it'd be weird to say "i like card suits" |
| 18:56:49 | brixen | well, "suit" is also a (sometimes desparaging) reference to a bigwig or establishment man |
| 18:58:24 | cremes | but you wouldn't wear one of those, would you? how do you wear an establishment man? |
| 18:58:46 | brixen | cremes: and I quote (myself) "I like suits" |
| 18:58:52 | brixen | I was disambiguating |
| 18:59:01 | cremes | heh |
| 19:08:12 | brixen | I want to see a diff inline with my code, is there a vim plugin for this? |
| 19:11:00 | seydar | brixen: i had to do that for work, but i wasn't smart enough to make a vim plugin |
| 19:11:39 | seydar | but you could try sed 's/> /> ooo/' to see the lines being added |
| 19:11:52 | seydar | let me know if you find a plugin that does that |
| 19:16:09 | brixen | it would make my life 100x easier dealing with rubyspec |
| 19:16:23 | brixen | I'll see if I can find something |
| 19:21:13 | BrianRice-work | tosses a dime at brixen. "Here, kid. Go buy yourself a real editor." |
| 19:24:26 | brixen | brianmario: oh? what would I buy? |
| 19:24:29 | brixen | ack |
| 19:24:33 | brixen | BrianRice-work: ? |
| 19:24:56 | brixen | brianmario: lurk on, sorry to disturb :) |
| 19:36:32 | BrianRice-work | brixen: teasing |
| 19:36:45 | BrianRice-work | brixen: emacs. ediff-mode for example |
| 19:36:51 | seydar | damn son |
| 19:36:54 | BrianRice-work | or annotate mode within vcs-mode |
| 19:37:36 | BrianRice-work | I was of course just making a reference to noir/gangster films of the 40s |
| 19:37:51 | brixen | BrianRice-work: ok, I'm pretty sure something exists, but I'll take a look at those if not |
| 19:40:17 | seydar | brixen: vim -d might do the trick |
| 19:41:58 | seydar | holy shit this thing is magical |
| 19:42:24 | seydar | brixen try vim -d everyone else is doing it and you should too |
| 19:43:11 | BrianRice-work | heh |
| 19:43:27 | brixen | seydar: okie |
| 19:43:45 | brixen | jeremyevans: I have specs that I'm reasonably happy with and 3 failures in rbx |
| 19:44:09 | brixen | jeremyevans: grabbing some lunch and a train ride back to pdx proper, so bbl... |
| 19:53:27 | seydar | holy shit vim -d is exactly it |
| 19:53:35 | seydar | you can expand the parts that diff hides |
| 19:53:37 | seydar | and holy shit |
| 19:53:40 | seydar | you just have to try it |
| 19:53:43 | seydar | oh my god |
| 19:57:36 | BrianRice-work | it's full of stars |
| 19:57:50 | BrianRice-work | :) |
| 20:09:41 | dbussink | evan: is that inline cache issue the same i was seeing yesterday? |
| 20:17:50 | brianmario | brixen: heh |
| 20:18:05 | brianmario | brixen: you just reminded me I need to add rb_obj_dup still... |