Show enters and exits. Hide enters and exits.
| 05:02:15 | evan | tarcieri: poke? |
| 05:03:30 | slava | hi evan |
| 05:03:38 | evan | hi slava! |
| 05:03:44 | evan | you still in portland? |
| 05:03:48 | slava | nope, in boston now |
| 05:04:29 | jakedouglas1 | sup |
| 05:04:52 | evan | hi jake! |
| 05:05:06 | jakedouglas1 | did i do the fiber thing right this time? |
| 05:05:26 | evan | lets see.. |
| 05:06:38 | evan | jakedouglas1: yep! looks good. |
| 05:06:43 | jakedouglas1 | cool. |
| 05:07:11 | jakedouglas1 | there are still 3 specs that fail but i think they probably need to be fixed in the compiler |
| 05:08:15 | evan | oh? |
| 05:08:17 | evan | seems unlikely. |
| 05:08:26 | evan | I don't see why Fiber would need compiler changes |
| 05:08:29 | jakedouglas1 | well, maybe 2 of them. or 1 of them. i duno |
| 05:08:31 | jakedouglas1 | ok well |
| 05:08:33 | evan | I assume you mean the bytecode compiler |
| 05:08:35 | jakedouglas1 | one of them just seems to be an issue with Proc |
| 05:08:35 | evan | which ones? |
| 05:08:47 | jakedouglas1 | and i dont think theres a rubyspec for it |
| 05:09:03 | jakedouglas1 | but Proc.new { break }.call should raise LocalJumpError |
| 05:09:06 | jakedouglas1 | that doesnt happen on rbx |
| 05:09:50 | tarcieri | evan: ohai, walking home from the bar there heh |
| 05:09:57 | evan | aah. |
| 05:10:11 | tarcieri | evan: yeah to get to the point, you can't do multicore programming in Rubinius without creating multiple VM instances, so long as the GIL exists :/ |
| 05:10:13 | evan | jakedouglas1: really? did you check that? |
| 05:10:29 | evan | oh weird. |
| 05:10:33 | evan | so it does. |
| 05:10:40 | evan | fucking proc/lambda/Proc.new interactions. |
| 05:10:45 | jakedouglas1 | yea. |
| 05:10:48 | evan | ignore it. |
| 05:11:05 | evan | that kind of crap is stuff i'm fine doing the very, very last. |
| 05:11:15 | evan | tarcieri: thats wrong |
| 05:11:21 | tarcieri | it is? |
| 05:11:22 | evan | you certainly can do multicore programming |
| 05:11:25 | evan | sure |
| 05:11:26 | tarcieri | in Ruby? |
| 05:11:33 | evan | one thread can be stopped in IO while another runs |
| 05:11:44 | tarcieri | yeah, as I was saying... for the I/O case sure |
| 05:11:51 | tarcieri | for multicore computation, no |
| 05:12:08 | evan | your point, and I think it's valid, is that true concurrent execution is required to make this kind of thing fast |
| 05:12:15 | jakedouglas1 | evan: the other two failing specs are |
| 05:12:21 | tarcieri | how would you scatter/gather an embarrisingly parallel problem across multiple cores in Rubinius today? |
| 05:12:27 | jakedouglas1 | "Fiber.new raises a SyntaxError when the block contains a retry statement" |
| 05:12:28 | evan | jakedouglas1: please point out which ones |
| 05:12:29 | jakedouglas1 | and "Fiber#resume executes the ensure clause" |
| 05:12:37 | evan | ok |
| 05:12:43 | evan | the Fiber.new one we won't support. |
| 05:12:47 | evan | pretty plainly |
| 05:12:52 | evan | thats probably a bad spec |
| 05:12:53 | evan | i'll check. |
| 05:12:57 | jakedouglas1 | ok. |
| 05:13:02 | evan | the ensure one is definitely something we should be doing |
| 05:13:04 | evan | i'll take a look. |
| 05:13:09 | jakedouglas1 | well |
| 05:13:15 | evan | o/~ and read a book, it's reading rainbow! o/~ |
| 05:13:17 | jakedouglas1 | i think the ensure one isnt even fixed in MRI yet |
| 05:13:19 | jakedouglas1 | its still an open bug |
| 05:13:22 | evan | aaah |
| 05:13:22 | evan | ok |
| 05:13:30 | tarcieri | evan: granted the fact you can even do concurrent I/O is a miracle compared to 1.8 :) |
| 05:13:32 | jakedouglas1 | but…what would need to change to fix it? |
| 05:13:39 | tarcieri | but 1.9 gives you the same thing |
| 05:13:48 | evan | jakedouglas1: i'll have to look at the spec to see what the behavior is. |
| 05:14:08 | evan | tarcieri: you can certainly do lazy computations with even MRI |
| 05:14:35 | evan | but I'll agree, they're not really lazy unless you've got true concurrency. |
| 05:14:47 | evan | since to run them, they must suck down GIL timeslices. |
| 05:14:48 | tarcieri | ohai MenTaLguY! |
| 05:14:51 | MenTaLguY | hello |
| 05:14:52 | evan | which starve other things. |
| 05:14:57 | MenTaLguY | I heard somebody say "thread" |
| 05:14:58 | tarcieri | you seem like a good participant for this conversation |
| 05:15:00 | evan | MenTaLguY: evening sir |
| 05:15:01 | evan | MenTaLguY: hahah |
| 05:15:03 | evan | you're awesome. |
| 05:15:20 | tarcieri | MenTaLguY: I was just talking to evan about dataflow |
| 05:15:21 | evan | tarcieri: I do agree with you |
| 05:15:24 | evan | btw |
| 05:15:34 | evan | I don't know excatly what dataflow does |
| 05:15:35 | tarcieri | evan: most Rubyists don't even thinking about using Ruby like that, FWIW |
| 05:15:45 | jakedouglas1 | evan: basically the desired behavior is that your ensure clause runs before transferring execution to another fiber. |
| 05:15:50 | evan | so I was trying to get a picture for what things it wanted to do concurrently |
| 05:15:56 | MenTaLguY | for the most part, dataflow just means expressing your data dependencies explicitly |
| 05:15:56 | tarcieri | concurrent I/O is what everyone needs... concurrent computation? most people assume it's unpossible |
| 05:16:19 | tarcieri | MenTaLguY: it just provides a less error-prone mechanism for the synchronization of concurrent computation than threads... |
| 05:16:19 | evan | tarcieri: well, Rubinius has concurrent I/O |
| 05:16:27 | MenTaLguY | it's sort of a declarative way of managing data dependencies, really, less explicit focus on synchronization, more focus on what depends on what else, and the scheduler takes care of the rest |
| 05:16:27 | tarcieri | evan: yeah fosho |
| 05:16:53 | evan | MenTaLguY: right, and allowing things to collapse to values from expressions when needed |
| 05:16:55 | MenTaLguY | futures are basically dataflow |
| 05:17:00 | evan | right |
| 05:17:02 | tarcieri | yeah totally |
| 05:17:02 | evan | i was about to say that. |
| 05:17:03 | MenTaLguY | I really need to finish revisiting lazy.rb soon |
| 05:17:15 | tarcieri | MenTaLguY: you should like... bust some Omnibus yo :) |
| 05:17:27 | MenTaLguY | yeah ... it's hard, juggling everything I'm doing |
| 05:17:29 | evan | tarcieri: well, don't worry your pretty little head |
| 05:17:40 | evan | the major feature of Rubinius 2.0 is the GIL removal. |
| 05:17:44 | tarcieri | evan: this is all pie in the sky theoretical shit even I don't have much of a use case for :/ |
| 05:17:51 | MenTaLguY | anyway, lazy.rb doesn't need omnibus per se, but I need to address the same major issues as with omnibus |
| 05:18:01 | MenTaLguY | so it's a good micro-project |
| 05:18:26 | evan | MenTaLguY: the GIL removal for 2.0 is what sparked my question to you the other day |
| 05:18:30 | evan | about locking primitives |
| 05:18:33 | MenTaLguY | nods |
| 05:18:49 | slava | you're already working on 2.0? |
| 05:18:59 | tarcieri | ohai slava |
| 05:18:59 | evan | slava: no |
| 05:19:17 | evan | slava: but i've already decided that true concurrency is the big 2.0 feature. |
| 05:19:30 | evan | similar to the way SMP was the big feature of linux 2.0 |
| 05:19:35 | tarcieri | heh |
| 05:20:28 | tarcieri | evan: I used to be all skeptical about true library level solutions to concurrency in Ruby, but now I'm not, thanks largely in part to JRuby and MenTaL's work on that |
| 05:20:43 | tarcieri | dataflow is a nifty one, so is Omnibus, if MenTaLguY ever finishes it :) |
| 05:20:53 | evan | tarcieri: well, library level support needs good locking prims |
| 05:21:21 | tarcieri | yeah it's obviously heavily dependent on VM-level support and fine grained locking at that level |
| 05:21:53 | evan | that JRuby's Mutex uses Java's locking support was the source of some of my thoughts on this subject |
| 05:22:11 | evan | ie, what VM-level mechanism should be provided to build on. |
| 05:22:14 | MenTaLguY | well, it kind of uses the Java stuff badly |
| 05:22:16 | tarcieri | COW in JRuby is pretty dopesaice |
| 05:22:22 | tarcieri | err, dopesauce |
| 05:22:23 | tarcieri | for Ruby :) |
| 05:22:27 | evan | COW? |
| 05:22:30 | evan | like in String? |
| 05:22:31 | tarcieri | copy on write |
| 05:22:39 | evan | .... and how is that related? |
| 05:22:42 | tarcieri | uhh, MenTaLguY, you wanna chime in here? |
| 05:22:50 | MenTaLguY | tarcieri: refresh my memory? |
| 05:22:53 | tarcieri | lol |
| 05:22:55 | tarcieri | never mind |
| 05:23:03 | evan | locking in terms of making sure the shared buffer is properly managed |
| 05:23:04 | MenTaLguY | there are a bunch of COW conversations I've had, different things... |
| 05:23:05 | tarcieri | I need to be full of less booze for this conversation |
| 05:23:06 | evan | i'd assume. |
| 05:23:20 | MenTaLguY | so, the one really interesting (but hard to implement) COW idea that we had at some point |
| 05:23:32 | MenTaLguY | was a shared-nothing thread model, that basically did a COW fork per thread |
| 05:23:55 | MenTaLguY | with a few Ruby types like Queue etc. being shared |
| 05:24:09 | evan | this is in JRuby? |
| 05:24:18 | MenTaLguY | as I said, not implemented, but discussed |
| 05:24:34 | tarcieri | MenTaLguY: I was thinking specifically relating to ivar mutations |
| 05:24:38 | evan | sounds need. |
| 05:24:46 | evan | neat |
| 05:24:47 | evan | rather. |
| 05:25:54 | MenTaLguY | yeah, there are a lot of gotchas, but I think it's potentially a much nicer idea than shared-by-default threads |
| 05:26:22 | evan | MenTaLguY: seems like no ruby code would run though |
| 05:26:23 | tarcieri | so that was all pie in the sky never got implemented stuff then? |
| 05:26:34 | evan | all ivar mutation would cause copying versions into threads |
| 05:26:42 | evan | and there would be no communication |
| 05:26:45 | MenTaLguY | evan: a surprising amount of stuff would work, out of what I looked at |
| 05:27:07 | evan | sure, but everything that didn't work would have no way of working |
| 05:27:10 | MenTaLguY | communication would indeed be limited to objects specifically designed for it, like instances of Queue etc. |
| 05:27:15 | evan | unless a Reference type was introduced |
| 05:27:20 | MenTaLguY | kind of |
| 05:27:21 | evan | and used to explicitly shared data. |
| 05:27:26 | MenTaLguY | yes |
| 05:27:44 | evan | then we can add some ('s and clojure! |
| 05:27:47 | evan | waves his magic wand |
| 05:27:47 | tarcieri | lol |
| 05:27:57 | tarcieri | headius seems all about STM |
| 05:28:04 | MenTaLguY | we are looking at exposing Clojure's persistent data structures and STM in JRuby actually |
| 05:28:51 | tarcieri | STM seems like by far the coolest use case of true concurrent native threads |
| 05:30:13 | tarcieri | but dataflow or thread-backed preemptive actors are other ones as well |
| 05:30:32 | MenTaLguY | or just data-parallel library stuff |
| 05:30:38 | tarcieri | yeah totally |
| 05:30:41 | MenTaLguY | if you want to do your computation in Ruby rather than dropping into C at least |
| 05:30:48 | tarcieri | yeah heh |
| 05:31:14 | MenTaLguY | but actually even if you want to do it in C and need to consult Ruby objects for part of it |
| 05:31:33 | evan | MenTaLguY: if you'd not mind, would you explain the difference between an STM library like clojure and just having datastructures that are threadsafe? |
| 05:32:09 | evan | to me, looking at clojure, seems to me that STM is just datastructures that participate in a scoped lock |
| 05:32:20 | MenTaLguY | not really |
| 05:32:22 | evan | which doesn't sound very radical at all. |
| 05:32:32 | MenTaLguY | thinking of it in terms of a lock is not a good mental model |
| 05:32:40 | evan | well |
| 05:32:50 | evan | i've got the mental model for it fine |
| 05:32:53 | evan | at the usage level |
| 05:32:59 | evan | i'm an implementation man though. |
| 05:33:16 | MenTaLguY | the big things about locks is that they imply blocking/exclusivity |
| 05:33:19 | evan | the story has to also be told with no makeup on. |
| 05:33:27 | MenTaLguY | STM (and transactions generally) represent an attempt to avoid/limit that |
| 05:33:49 | evan | certainly, by queueing writes and executing them atomicly |
| 05:34:04 | evan | the atomicness must be a blocking/exclusive operation though |
| 05:34:17 | evan | so it still is one, you've simply delayed it |
| 05:34:28 | MenTaLguY | not really |
| 05:34:42 | evan | oh? |
| 05:35:17 | MenTaLguY | some STM implementations really push a lockfree/optimistic model |
| 05:35:48 | MenTaLguY | you still end up having to back off/retry if there's a conflict |
| 05:35:56 | MenTaLguY | but in the no-conflict case nobody blocks on anything |
| 05:36:23 | MenTaLguY | locks are a way to get consistent updates, but not the only way |
| 05:36:44 | evan | so you'd check for a conflict before writing out the transation, and run unlocked if there isn't one |
| 05:37:08 | MenTaLguY | not really |
| 05:37:14 | MenTaLguY | maybe you should read the Haskell STM paper |
| 05:37:18 | evan | i'm getting a lot of not really's tonight. |
| 05:37:26 | evan | ok |
| 05:38:29 | MenTaLguY | in principle, the only thing you should ever have to block on is IO or a data dependency |
| 05:39:00 | MenTaLguY | concurrent updates of data structures don't need blocking at all -- at least in theory |
| 05:39:10 | MenTaLguY | in practice designing lockfree data structures is something of rocket science |
| 05:39:42 | evan | i'm not much of a theory man |
| 05:40:01 | evan | the in practice is the thing that interests me. |
| 05:40:28 | MenTaLguY | there are a lot of tradeoffs either way |
| 05:40:36 | evan | in theory we can fly to mars. It's the in practice that's a lot more interesting. |
| 05:41:20 | tarcieri | MenTaLguY: like debugging difficulty for the end-user? |
| 05:41:45 | MenTaLguY | tarcieri: not so much, but predictable performance characteristics at least |
| 05:41:56 | MenTaLguY | like, for example |
| 05:42:02 | MenTaLguY | most people want "fair" primitives |
| 05:42:11 | MenTaLguY | but those are subject to convoying and generally have lower throughput |
| 05:42:33 | MenTaLguY | (we get bugs filed against JRuby that certain things aren't fair on a fairly regular basis) |
| 05:43:45 | tarcieri | MenTaLguY: I found Clojure confusing :/ |
| 05:43:54 | MenTaLguY | howso? |
| 05:44:09 | tarcieri | I just couldn't wrap my brain around it in the same way as shared-nothing approaches to concurrency |
| 05:44:31 | MenTaLguY | to which aspect of clojure are you referring in this case? |
| 05:44:39 | tarcieri | transactions and STM |
| 05:44:55 | tarcieri | CSP is just so much easier to think about |
| 05:45:05 | evan | I hear that large parts of clojure are being rewritten in clojure itself. It will be interesting to see if they can implement the STM system in clojure itself. |
| 05:45:20 | MenTaLguY | I think so |
| 05:45:26 | MenTaLguY | I can't think of anything which would prevent it |
| 05:46:53 | evan | well, would the same apply to ruby? |
| 05:47:12 | MenTaLguY | I've implemented STM in Ruby before |
| 05:48:00 | MenTaLguY | the main disadvantage in Ruby versus Clojure is that in Clojure you can more or less close the performance gap with Java, which isn't really possible in Ruby |
| 05:48:55 | evan | but that's STM in the form of special classes, I'm assuming. |
| 05:49:06 | evan | I guess I was thinking systematic STM |
| 05:49:17 | MenTaLguY | I woudln't ever recommend systematic STM |
| 05:49:21 | evan | ivar writes participate in STM, for example |
| 05:49:22 | evan | oh? |
| 05:49:27 | evan | isn't clojure that? |
| 05:49:31 | MenTaLguY | Haskell doesn't do it, Clojure doesn't do it... |
| 05:49:39 | MenTaLguY | no |
| 05:49:51 | MenTaLguY | One of the reasons has to do with a basic principle of transactions |
| 05:50:22 | evan | so just a special set of data structures perform STM |
| 05:50:24 | MenTaLguY | namely, transactions work badly if your transactions are large |
| 05:50:46 | MenTaLguY | yes |
| 05:50:50 | evan | and, in the case of clojure, it just so happens that the default datastructures use STM |
| 05:51:04 | MenTaLguY | Haskell has TVars, Clojure has Refs |
| 05:51:06 | MenTaLguY | no |
| 05:51:16 | evan | aren't clojures lists and maps STM? |
| 05:51:19 | MenTaLguY | the default data structures in Clojure are pure functional/persistent data structures |
| 05:51:20 | MenTaLguY | no |
| 05:51:35 | evan | ah ok |
| 05:51:49 | evan | looks like I've just had an incorrect view of the existing work |
| 05:52:08 | evan | is Ref the only STM construct in clojure? |
| 05:52:14 | MenTaLguY | yes |
| 05:52:22 | MenTaLguY | TVars are the only STM thing in Haskell |
| 05:52:31 | MenTaLguY | STM::Variable was the only thing in my last Ruby STM implementation |
| 05:52:36 | evan | so, multiple Ref writes are queued and performed atomicly in the transation |
| 05:52:43 | evan | ah! |
| 05:53:01 | evan | I always thought SMT was systemic |
| 05:53:04 | evan | STM, rather. |
| 05:53:17 | evan | is HTM systemic? not that it's been really implemented. |
| 05:53:52 | MenTaLguY | hm, usually not |
| 05:54:20 | evan | so a big part of STM is programmer education |
| 05:54:24 | evan | use X, not Y |
| 05:54:29 | MenTaLguY | basically it's not worth the overhead to make everything transaction-safe, just like it's not worth the overhead to make everything "thread-safe" |
| 05:54:44 | MenTaLguY | which gets back to an issue I keep having to try to drive home to people |
| 05:54:58 | evan | gotcha! |
| 05:55:05 | evan | ok, cool. |
| 05:55:19 | MenTaLguY | *most* of your data structures/types/etc shoudln't be used for communicating between concurrent processes (threads, etc.) |
| 05:55:42 | MenTaLguY | considering that everyone's so hung up on performance, there's a performance tradeoff in making something safe to be used as a communication channel in the first place |
| 05:55:47 | evan | right, pushing and poping from a bare Array isn't a good idea. |
| 05:56:54 | MenTaLguY | generally speaking I think computation and communication are kind of separate domains, or should be |
| 05:57:29 | evan | ah ok |
| 05:57:44 | evan | I'd agree there. |
| 05:58:52 | MenTaLguY | so the thing about STM is that it's a communication mechanism which has semantics which mimic local storage |
| 05:59:14 | evan | local storage is an local variables? |
| 05:59:24 | MenTaLguY | if you like |
| 05:59:38 | MenTaLguY | not syntactically, but semantically a bit I guess |
| 06:00:34 | evan | yes, semantically |
| 06:00:39 | evan | a place to call your own |
| 06:00:41 | evan | if you will. |
| 06:01:27 | MenTaLguY | locks are kind of a different approach, you basically use real local variables and then synchronize them around via the lock |
| 06:01:39 | evan | MenTaLguY: so i guess we'd say that Ruby could really use a goto STM toolkit |
| 06:01:44 | evan | go to, rather. |
| 06:02:04 | evan | to begin the programmer education |
| 06:02:17 | MenTaLguY | ponders |
| 06:02:57 | MenTaLguY | really I think for the most part we need CSP/PI-calc channels, atomic locations, and persistent data structures |
| 06:03:15 | MenTaLguY | also good data-parallel libraries |
| 06:04:12 | MenTaLguY | STM is kind of a dead-end crutch |
| 06:04:26 | evan | oh? seems like a building block |
| 06:04:43 | MenTaLguY | it's like corn ethanol as a petrolum substitute |
| 06:05:54 | evan | so you'd prefer to make cross thread mutications entirely a communication game |
| 06:05:56 | evan | using channels |
| 06:06:10 | MenTaLguY | ideally yes, for a sufficiently broad idea of channels |
| 06:06:26 | evan | seems good |
| 06:06:55 | evan | it's been years now since you introduce Channels to rubinius |
| 06:07:04 | MenTaLguY | I won't say STM is never an appropriate solution, but I've written roughly three STM implementations so far and the things I learned about tradeoffs kind of put me off them |
| 06:07:05 | evan | perhaps it's time to rediscuss and see how they can be improved on |
| 06:07:15 | MenTaLguY | yeah |
| 06:07:33 | MenTaLguY | my intention was always that we'd have specializations of the channel idea which were optimized for particular use cases |
| 06:08:10 | evan | what are some of the varitions you could see among different kinds of channels? |
| 06:08:19 | tarcieri | MenTaLguY: what do you think about STM not being particularly applicable to shared state problems like Chameneos |
| 06:08:26 | evan | more than just async/sync receiving, I'd assume. |
| 06:08:34 | tarcieri | shared state concurrency problems, that is |
| 06:10:07 | MenTaLguY | well, (as I reacall) the fastest Chameneos implementations didn't use STM |
| 06:10:13 | tarcieri | indeed |
| 06:10:37 | MenTaLguY | evan: well, things like bounded size, also things like the semaphore optimization (though that one seems easy enough to do automatically) |
| 06:10:50 | evan | MenTaLguY: yeah, i'm planning to add that this week |
| 06:10:58 | evan | the semaphore optimization |
| 06:11:04 | MenTaLguY | nods |
| 06:11:21 | evan | or, should I say, readd. |
| 06:11:21 | evan | :) |
| 06:12:09 | evan | there is a very fine art to lock ownership |
| 06:12:16 | evan | which I've not yet mastered |
| 06:12:17 | evan | lock/channel |
| 06:12:26 | MenTaLguY | ah? |
| 06:12:48 | evan | meaning, carrying around one lock per data structure is a pain |
| 06:13:03 | evan | but use a application level lock means sucking down performance |
| 06:13:34 | evan | which is, imho, one reason why the JVM object-as-monitor approach is nice |
| 06:13:41 | MenTaLguY | well, that's actually a more general issue |
| 06:13:47 | evan | makes introduces locks at different levels easier |
| 06:13:52 | MenTaLguY | which touches on all sorts of things like performance, architecture, etc |
| 06:14:01 | evan | course, then you have the problem of going "eek! which object do I lock again?" |
| 06:14:06 | MenTaLguY | i.e. what granularity of communication do you want between concurrent tasks? |
| 06:14:26 | evan | the syncronize keyword at least makes locking part of the interface |
| 06:14:35 | evan | MenTaLguY: yep yep |
| 06:16:05 | MenTaLguY | one question that I think you may need to step back and ask as far as the Rubinius core goes, is where are your major communication points? |
| 06:16:54 | evan | is constant tables one of the answers? |
| 06:16:58 | evan | ie, that level |
| 06:17:04 | MenTaLguY | elaborate? |
| 06:17:21 | evan | actually, no |
| 06:17:27 | evan | lets use my example from earlier |
| 06:17:31 | evan | class creation |
| 06:17:59 | evan | making sure that to threads running 'class Blah; end' get a consistent view |
| 06:18:06 | evan | and that there aren't 2 classes named Blah created |
| 06:18:15 | evan | is that the level you were thinking? |
| 06:18:44 | evan | places where the shared memory must be written to |
| 06:19:08 | MenTaLguY | sort of |
| 06:19:21 | MenTaLguY | notionally, Ruby has this tree of classes/modules related by constant assignments |
| 06:19:46 | evan | sure |
| 06:20:14 | MenTaLguY | certain operations, like creating and naming a non-anonymous class, might need to happen atomically |
| 06:20:18 | MenTaLguY | though, I still wonder |
| 06:20:33 | MenTaLguY | if you wrote: Blah = Class.new do; end |
| 06:20:43 | MenTaLguY | does that really need to be different? |
| 06:21:12 | MenTaLguY | if you've got two threads each doing class Blah at the same time... part of me says you get to keep both pieces |
| 06:21:52 | MenTaLguY | I know the idea there is that the threads can independently extend the class, whoever wins the race, but often it matters when you're adding features to a class what order they are added in, overall |
| 06:21:57 | evan | one thread should raise "constant already defined" |
| 06:22:03 | evan | i'd assume. |
| 06:22:18 | MenTaLguY | I think it's a warning rather than an exception in practice |
| 06:22:27 | evan | it's not |
| 06:22:29 | evan | it's an exception. |
| 06:22:50 | evan | oh me |
| 06:22:51 | evan | no |
| 06:22:53 | evan | it's a warning |
| 06:22:54 | evan | :/ |
| 06:23:03 | evan | at any rate |
| 06:23:40 | evan | my thinking is that in the case of 'class Blah' because Blah is created lazily, there shouldn't be 2 of them. |
| 06:24:15 | evan | so yes, I'd think it should be different |
| 06:24:24 | evan | because 'class Blah;' is not 'Blah = Class.new' |
| 06:25:09 | MenTaLguY | well, I probably should have compared to (Blah ||= Class.new).class_eval do; end really |
| 06:26:23 | evan | sure |
| 06:26:34 | evan | which asks the same question of ||= |
| 06:26:56 | evan | if the answer is "user is dumb, shooting themself" |
| 06:27:06 | evan | then it's easy. |
| 06:27:38 | evan | but if we want to say that we try produce a sane result, it's not. |
| 06:27:50 | evan | again, perhaps it's your definition of sane that's being tested. |
| 06:29:44 | evan | well, these are all good questions |
| 06:29:49 | evan | that I have no solid answers to |
| 06:29:57 | evan | I'll think about them in the shower tomorrow. |
| 06:33:56 | MenTaLguY | nods |
| 06:38:38 | evan | sadly |
| 06:39:09 | evan | some of these questions are answered by saying "well, autoload is valid semantics and it's fucking broken, so this can be the same as autoload" |
| 06:39:10 | evan | anyway |
| 06:39:11 | evan | nite! |
| 06:39:16 | evan | thanks the chat |
| 06:39:20 | MenTaLguY | 'night |
| 06:39:22 | MenTaLguY | you're welcome |
| 07:03:21 | dbussink | morning :) |
| 11:48:25 | boyscout | File#ungetc specs didn't require fixtures explicitly - fd655bb - Dirkjan Bussink |
| 11:57:05 | boyscout | CI: rubinius: fd655bb successful: 3498 files, 14416 examples, 42216 expectations, 0 failures, 0 errors |
| 15:31:55 | jakedouglas | morning |
| 15:35:04 | sbryant | Morning |
| 15:59:29 | evan | morning. |
| 16:00:07 | cremes | mornin' |
| 16:35:06 | brixen | morning |
| 16:38:58 | evan | brixen: hey there busy boy |
| 16:39:11 | brixen | :) |
| 16:39:14 | brixen | this is awesome http://news.yahoo.com/s/ap/20100726/ap_on_hi_te/us_tec_digital_copyright |
| 16:39:18 | brixen | thanks Defiler |
| 16:39:22 | Defiler | o7 |
| 16:39:39 | evan | nice. |
| 16:39:57 | brixen | now we just need a successful class action suit against att for their prices vs shit ass service |
| 16:40:10 | evan | yeah, the gov't is finally getting tech savey enough to realize the DMCA was wool being pulled over their eyes |
| 16:40:18 | brixen | yeah |
| 16:40:20 | evan | only took them 12 years! |
| 16:40:22 | evan | O_o |
| 16:40:28 | brixen | cutting edge |
| 16:41:30 | brixen | let's see, where did I put these boxes... I need to do some (un)packing :) |
| 16:41:46 | evan | :D |
| 16:41:51 | evan | how did the talk go? |
| 16:42:13 | brixen | good, I had way too much to talk about |
| 16:42:28 | evan | yeah, that happens. |
| 16:42:34 | brixen | and realized that it's actually a bit more complicated than I expected to talk about the bytecode compiler |
| 16:42:42 | brixen | I want to do a series of screencasts actually |
| 16:43:02 | brixen | I have a few edits to my slides and I'll put them up |
| 16:43:45 | brixen | pegarus is coming along pretty good |
| 16:43:55 | evan | which part is that? |
| 16:43:56 | brixen | but I need to add optimization passes |
| 16:44:01 | brixen | the peg |
| 16:44:04 | evan | rad |
| 16:44:09 | evan | i was looking at pegs last night |
| 16:44:37 | brixen | they are fun |
| 16:44:40 | brixen | but slava hates them |
| 16:44:43 | brixen | :) |
| 16:45:13 | Defiler | Suddenly I am more interested in PEGs ;) |
| 16:45:14 | evan | so, is that the port of lpeg? |
| 16:46:10 | brixen | http://gist.github.com/490818 |
| 16:46:28 | brixen | this is using the SNOBOL first-class object method |
| 16:46:41 | evan | yep, looks like it |
| 16:46:50 | evan | i read the lpeg stuff yesterday actually |
| 16:46:52 | brixen | it's rather verbose, but the LPEG paper suggests that most people use that facility to do major grammars |
| 16:46:53 | evan | the description, not the code. |
| 16:47:10 | evan | it seems a bit clunky is my worry |
| 16:47:16 | evan | compared to a dedicated grammar syntax |
| 16:47:20 | brixen | well, there is also a peg grammar to |
| 16:47:21 | brixen | er too |
| 16:47:30 | brixen | that's in the re module in lua |
| 16:48:03 | evan | yeah, i saw |
| 16:48:08 | brixen | oek |
| 16:48:10 | brixen | -e |
| 16:48:11 | evan | the lua paper was a little hard for me |
| 16:48:21 | evan | because lua syntax was getting in the way |
| 16:48:23 | evan | crap like |
| 16:48:26 | brixen | did you read the long one? the one that was published in a book? |
| 16:48:31 | brixen | www.inf.puc-rio.br/~roberto/docs/peg.pdf |
| 16:48:32 | evan | lpeg.P"b"^0 |
| 16:48:46 | evan | i'm like "really guys? really?" |
| 16:48:49 | brixen | oh god, yeah lua is O_o |
| 16:48:53 | brixen | haha |
| 16:48:55 | brixen | exactly |
| 16:49:42 | evan | i'm fixing melbourne's syntax error reporting |
| 16:49:45 | brixen | peg = Pegarus.grammar :grammar |
| 16:49:45 | brixen | peg.grammar = (peg.nonterminal + Pegarus.pattern("<-") + :sp + :pattern) * 1 |
| 16:49:45 | brixen | peg.pattern = peg.alternative + (Pegarus.pattern("/") + :sp + :alternative) |
| 16:49:45 | brixen | peg.alternative = (Pegarus.pattern(["!", "&"]) * -1 + :sp + :suffix) * 1 |
| 16:49:45 | evan | btw |
| 16:49:50 | brixen | er misfire |
| 16:49:51 | brixen | sorry :/ |
| 16:49:54 | evan | hah |
| 16:49:55 | evan | np. |
| 16:49:58 | brixen | but that's defining a grammar |
| 16:50:07 | brixen | the peg grammar actually |
| 16:50:13 | evan | i was checking out the ruby ometa on github |
| 16:50:18 | evan | that seems to be abandoned |
| 16:50:22 | brixen | yeah, fun stuff |
| 16:50:34 | brixen | I think I got it to do something |
| 16:50:38 | brixen | but not sure what |
| 16:50:44 | brixen | so I gave up |
| 16:51:03 | evan | I was also thinking about forking treetop |
| 16:51:14 | evan | and making the syntax a bit more terse |
| 16:51:20 | evan | and fixing some of the pain points. |
| 16:51:50 | brixen | yeah, that's what this is :) |
| 16:51:54 | brixen | this == pegarus |
| 16:52:08 | evan | well, this looks MORE verbose that treetop |
| 16:52:09 | evan | :D |
| 16:52:16 | brixen | no no no :P |
| 16:52:27 | evan | also, i don't see how you run code as actions |
| 16:52:40 | evan | lpeg just talks about capturing elements |
| 16:52:53 | brixen | grammar <- (nonterminal '<-' sp pattern)+ |
| 16:52:58 | brixen | that's not verbose |
| 16:53:01 | evan | oh! |
| 16:53:05 | evan | see |
| 16:53:08 | brixen | so, lpeg has a shitton of capture types |
| 16:53:09 | evan | i thought it was just the ruby API above |
| 16:53:16 | brixen | that is the ruby above |
| 16:53:21 | brixen | but there is a module that parses that |
| 16:53:27 | brixen | because the peg grammar is just a peg |
| 16:54:10 | brixen | I'm going for: grammar = (nonterminal '=' sp pattern)+ -> { <capture here> } |
| 16:54:12 | brixen | probably |
| 16:54:12 | evan | ok, so you use the ruby API to parse a terse syntax |
| 16:54:16 | evan | bootstrap style |
| 16:54:17 | brixen | yep |
| 16:54:21 | evan | gotcha. |
| 16:54:34 | evan | is it doing memoization? |
| 16:54:41 | brixen | it does, yes |
| 16:54:45 | evan | sweet |
| 16:54:52 | brixen | there is an insn to push a choice obj onto the stack |
| 16:54:56 | evan | is it up anywhere? |
| 16:55:14 | brixen | choice is not implemented yet |
| 16:55:29 | brixen | http://github.com/brixen/pegarus |
| 16:55:57 | brixen | just pushed some stuff |
| 16:56:16 | brixen | hmm, I should put my slides up, there is a gentle intro in them |
| 16:56:19 | brixen | gentle for you :) |
| 16:56:32 | evan | :D |
| 16:57:28 | brixen | evan: check my elle home dir for oscon10.pdf |
| 16:57:34 | evan | k |
| 16:57:53 | brixen | I'll post those once I do a few edits, but you can have a look at how the codegen is done right now |
| 16:58:15 | brixen | so, starting on slide 37 |
| 16:58:23 | evan | hah |
| 16:58:24 | evan | slide 4 |
| 16:58:28 | brixen | :) |
| 16:58:54 | brixen | you are in all my rubinius talks, as that picture |
| 16:59:51 | jakedouglas | evan: having trouble using your json gem |
| 16:59:57 | evan | ok |
| 16:59:59 | evan | wassup with it |
| 17:01:32 | jakedouglas | http://gist.github.com/490840 |
| 17:01:37 | evan | brixen: oh man! I guess I didn't realize you were at the stage of generating bytecode |
| 17:01:38 | evan | thats awesome. |
| 17:01:44 | jakedouglas | some kind of path confusing?.. |
| 17:01:51 | jakedouglas | s/confusing/confusion |
| 17:01:54 | evan | jakedouglas: um |
| 17:01:58 | evan | don't you just require 'json' |
| 17:01:58 | evan | ? |
| 17:02:04 | evan | requiring a subpart probably won't work |
| 17:02:34 | jakedouglas | i don't know. i've always seen the json/ext been used |
| 17:02:43 | evan | I dunno then |
| 17:02:48 | evan | thats all inside the json gem |
| 17:02:51 | evan | i've used it before |
| 17:03:00 | evan | i can try doing require 'json/ext' here though |
| 17:03:38 | Defiler | you're supposed to just require 'json' |
| 17:03:45 | Defiler | and it decides if the native extension is there |
| 17:03:58 | Defiler | but the docs for that gem are horrible so many people do the json/ext thing |
| 17:04:03 | jakedouglas | ok well |
| 17:04:20 | jakedouglas | it's not able to load the extension even just when require 'json' |
| 17:04:37 | jakedouglas | it tries to load the extension and falls back |
| 17:04:41 | jakedouglas | but the extension is there and it's not loading it |
| 17:04:50 | evan | jakedouglas: hm, ok |
| 17:04:52 | evan | let me try here. |
| 17:04:53 | evan | one sec. |
| 17:07:42 | evan | brixen: how many people came to your talk? |
| 17:07:58 | evan | with so many things all at once at oscon, seems like a crap shoot for people showing up |
| 17:08:28 | brixen | about 15 |
| 17:08:42 | evan | ok |
| 17:08:46 | brixen | yeah, the conf is so broad, there are like 12 talks at any one time |
| 17:09:09 | brixen | I did get some spill for the last 10 minutes because state of the onion was in my room following my talk |
| 17:09:48 | evan | aah. |
| 17:10:05 | brixen | evan: so what I'm pondering is whether to do optimization pass as tree manipulation or operate on a stream of insns for the parsing machine |
| 17:10:29 | evan | operate on the stream for optimizations, you mean? |
| 17:10:30 | brixen | in the bytecode() methods I call the machine "insns" (ruby methods that emit bytecode) |
| 17:10:33 | brixen | yeah |
| 17:10:47 | brixen | eg any(1) + any(2) => any(3) |
| 17:10:52 | evan | well |
| 17:10:52 | brixen | as a super simplistic one |
| 17:10:58 | evan | you'd do a combo probably |
| 17:11:11 | evan | a tree transform for that seems easy |
| 17:11:23 | brixen | but there are some serious opts possible, like a (b c) emits much better code as (a b) c |
| 17:11:37 | brixen | er a / (b / c) rather |
| 17:11:39 | evan | nice |
| 17:11:50 | evan | my worry about doing it at the bytecode level is atm it appears you're loosing info |
| 17:12:01 | brixen | the LPEG paper discusses a bunch of the opts |
| 17:12:07 | evan | because you lower stuff to stuff like 'if str.size >= 1' ... |
| 17:12:12 | brixen | right |
| 17:12:25 | brixen | I need to abstract eg advancing the subject index |
| 17:12:26 | evan | if you optimize that bytecode stream, it's going to be more difficult |
| 17:12:32 | brixen | to make &patt or !patt work |
| 17:12:54 | brixen | oh! I don't mean rbx bytecode stream |
| 17:12:58 | evan | oh? |
| 17:13:04 | evan | now i'm confused. |
| 17:13:04 | brixen | I mean a stream of the parsing machine insns |
| 17:13:09 | brixen | like any(), char() |
| 17:13:18 | evan | ... |
| 17:13:20 | evan | i don't follow. |
| 17:13:26 | brixen | see slide 50, 51 |
| 17:13:31 | brixen | see the bytecode method? |
| 17:13:50 | brixen | it calls one of the parsing machine "insns", which emits rbx bytecode |
| 17:14:08 | evan | ah ok |
| 17:14:11 | brixen | the semantics of the AST are essentially expressed in a series of machine instructions |
| 17:14:18 | brixen | that the LPEG paper discusses |
| 17:14:22 | evan | ok, i was going to suggest that also |
| 17:14:34 | evan | you've got another representation between tree and rbx bytecode |
| 17:14:39 | brixen | yeah |
| 17:14:41 | evan | which is a linearization of the tree |
| 17:14:49 | evan | that would be easy to do opts on |
| 17:14:55 | evan | because it doesn't loose info |
| 17:14:59 | brixen | right, simple pattern matching works |
| 17:15:00 | evan | and you can do peephole opts |
| 17:15:04 | brixen | yeah |
| 17:15:06 | evan | lose info, rather. |
| 17:15:18 | evan | ie |
| 17:15:21 | evan | any g, 1 |
| 17:15:23 | evan | any g, 2 |
| 17:15:30 | evan | turns into 'any g, 3' |
| 17:15:34 | brixen | right |
| 17:15:39 | evan | i'd do it at that level |
| 17:15:40 | evan | thats easy. |
| 17:15:51 | evan | er. easier :D |
| 17:15:55 | brixen | I'm concerned about losing some info actually |
| 17:16:07 | brixen | the tree represents associativity naturally |
| 17:16:08 | evan | which info? |
| 17:16:16 | evan | yes, thats true |
| 17:16:23 | brixen | a / (b / c) eg |
| 17:16:35 | brixen | but I'm not sure that's a problem yet |
| 17:16:38 | brixen | just pondering |
| 17:16:48 | evan | no reason to restrict yourself to one strategy |
| 17:16:53 | brixen | true |
| 17:17:01 | evan | peephole on the linearization is nice for a class of optimizations |
| 17:17:05 | evan | tree transform is nice for another |
| 17:17:18 | brixen | wait, I want a one-size fits all! :) |
| 17:18:30 | evan | then you get a floppy hat that everyone hates |
| 17:18:31 | evan | :D |
| 17:18:37 | brixen | hah |
| 17:19:09 | brixen | so, most of the structure is in place with pegarus, I just need to finish codegen and add captures |
| 17:19:34 | brixen | this page has docs on lpeg http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html |
| 17:19:38 | brixen | see the captures section |
| 17:20:03 | brixen | unfortunately, I don't really know lua so this is rather <waves hands> |
| 17:21:39 | brixen | also, I think I'll follow ruby semantics with #match (returns matches or capture data structure) and #=~ returns the index past the match |
| 17:22:21 | brixen | also, match() is lua only matches a prefix of a string, while find() is implicitly: S / . S |
| 17:22:21 | evan | hm |
| 17:22:21 | evan | k |
| 17:22:27 | brixen | ie, it searches for the start of the pattern |
| 17:25:44 | brixen | say it ain't so: http://bit.ly/c8SpvZ |
| 17:27:06 | brixen | "the rig's safety alarm had been habitually switched to a bypass mode to avoid waking up the crew with middle-of-the-night warnings." |
| 17:27:10 | brixen | brilliant |
| 17:27:42 | jakedouglas | evan: any idea about why the json extension doesn't get loaded? |
| 17:29:19 | evan | jakedouglas: sorry, about to look. |
| 17:29:26 | jakedouglas | np |
| 17:30:48 | evan | brixen: geez. |
| 17:30:58 | evan | why the fuck are things like that dependent on windows |
| 17:31:02 | evan | thats fucking scary. |
| 17:32:18 | Defiler | Everything runs on Windows |
| 17:33:07 | Defiler | What happens is somebody makes a fancy $$$$ GUI app for Windows because that's what they use |
| 17:33:13 | Defiler | and then it gets integrated into the workflow of something big |
| 17:33:24 | Defiler | and now some poor bastard is stuck making a Windows system into something production-quality |
| 17:33:31 | brixen | evan: well technically we don't know it was windows, but seriously, disabling an alarm on a rig like that? |
| 17:33:33 | Defiler | but they don't want to get fired so they don't just laugh and run away |
| 17:33:50 | evan | :| |
| 17:33:51 | brixen | Defiler: yeah, pretty sad |
| 17:34:02 | Defiler | here's a sample from back when I worked with the big $$$ |
| 17:34:04 | Defiler | http://hellninjacommando.com/temp/awesome_sql.png |
| 17:34:19 | evan | jakedouglas: works fine here |
| 17:34:20 | Defiler | I'll let that sink in for a second, and then tell you that that was as simple and reliable as I could make it, given the tools at hand. |
| 17:34:26 | evan | did you install the json-1.4.3 gem? |
| 17:34:30 | evan | not just json_pure |
| 17:34:58 | evan | Defiler: oh man. |
| 17:35:12 | Defiler | Five previous teams had failed at, basically, writing that query |
| 17:35:13 | jakedouglas | evan: is the extension loading? |
| 17:35:13 | evan | Defiler: I was hoping there was going to be a nested insert in there or something |
| 17:35:13 | Defiler | so they gave it to me |
| 17:35:18 | Defiler | on the final escalation team |
| 17:35:36 | jakedouglas | evan: i ran 'rake gem' in the json repository and that's what i got out |
| 17:35:37 | evan | jakedouglas: "json/ext/parser.bundle" is in $" |
| 17:35:38 | evan | so yes. |
| 17:35:51 | evan | whats what you got out? |
| 17:36:04 | evan | if you only got json_pure out |
| 17:36:07 | evan | then thats why |
| 17:36:08 | Defiler | Also, thank you for existing, gvim-on-windows |
| 17:36:16 | evan | you need to install just json to get the extension |
| 17:36:59 | jakedouglas | okay. any idea how i just get 'json'? |
| 17:37:18 | evan | i ran 'rake gem' |
| 17:37:27 | evan | and it was built into pkg/ |
| 17:37:57 | evan | oh you know |
| 17:38:02 | evan | i ran 'rake gem' with MRI |
| 17:38:03 | evan | not rbx |
| 17:38:13 | evan | i wonder if the json rakefile has some crap to detect MRI explicitly |
| 17:38:27 | jakedouglas | i did it with my system ruby too. |
| 17:38:31 | jakedouglas | same result. |
| 17:39:09 | evan | did it make pkg/json-1.4.3.gem? |
| 17:39:14 | jakedouglas | no. |
| 17:39:20 | jakedouglas | pkg/json_pure-1.4.3.gem |
| 17:39:55 | evan | i don't know why that is. |
| 17:40:50 | evan | do you maybe have an old version of rake? |
| 17:41:51 | jakedouglas | k |
| 17:41:52 | evan | looks like it depends on having Rake::ExtensionTask |
| 17:42:42 | evan | oh, install rake-compiler |
| 17:42:54 | jakedouglas | yea just noticed that. installing. |
| 17:42:55 | jakedouglas | thanks |
| 17:43:15 | evan | the warning it printed out was something you needed to heed :D |
| 17:43:36 | jakedouglas | :p |
| 17:46:08 | jakedouglas | you'll be happy to know that after disabling libxml-ruby and a few minor tweaks, our other codebase (not the huge one) passes it's whole test suite on rbx |
| 17:46:25 | brixen | woot! |
| 17:46:26 | evan | sweet! |
| 17:47:20 | jakedouglas | there's an issue with some gem called 'templater' that rspec and some other things seem to depend on |
| 17:47:41 | evan | rspec depends on it? |
| 17:47:51 | evan | i've run rspec before... |
| 17:48:05 | jakedouglas | it defines some version of 'instance_exec' (not sure if you're familiar with it) that really messes something up |
| 17:48:23 | evan | yes, i know instance_exec |
| 17:48:33 | evan | and I know the version in question |
| 17:48:36 | evan | it's insane. |
| 17:48:39 | jakedouglas | heh |
| 17:48:44 | evan | we should support it, but I almost don't want ti |
| 17:48:48 | evan | it has 1000 problems |
| 17:48:58 | jakedouglas | if I open up the templater gem and make it so it doesn't define that, everything works fine. |
| 17:50:18 | jakedouglas | i don't even really understand how instance_exec is supposed to work, so i didn't bother trying to understand what it was doing. |
| 17:51:40 | evan | i'm betting it defines the fucked up instance_exec that showed up in rails at one point |
| 17:51:43 | evan | it's beyond terrible. |
| 17:52:09 | jakedouglas | uh oh. installing your new json gem is making everything blow up again. we were using an older version before (1.2.4). |
| 17:52:24 | jakedouglas | StackError |
| 17:52:32 | evan | fun |
| 17:52:33 | evan | :/ |
| 17:52:56 | jakedouglas | darn. |
| 17:53:09 | jakedouglas | anyway, the gem needs a patch |
| 17:53:40 | jakedouglas | (i wonder if the patch just broke it. hmm.) |
| 17:53:59 | jakedouglas | brb. |
| 17:58:24 | dbussink | jakedouglas: json 1.4.3 is broken is my experience |
| 17:58:38 | dbussink | also had stackerrors all over the place with that one |
| 17:59:14 | brixen | code samples that cause stack errors? |
| 17:59:42 | brixen | we should be fixing those issues in rbx |
| 17:59:49 | brixen | or is this happening in mri too? |
| 18:00:36 | boyscout | Track all syntax errors and raise the first one - d2c3afb - Evan Phoenix |
| 18:00:36 | boyscout | Have mspec --spec-debug use the rbx reference debugger - 57405cc - Evan Phoenix |
| 18:00:36 | boyscout | A bunch of debugger improvements - 7cf1601 - Evan Phoenix |
| 18:01:40 | brixen | xmas! |
| 18:01:54 | evan | :D |
| 18:01:58 | slava | brixen: I'm working on the slides for my talk later today :) |
| 18:02:00 | Defiler | zmas! |
| 18:02:18 | brixen | slava: fun! |
| 18:02:19 | evan | so, yeah, you can now debug specs very easily |
| 18:02:27 | evan | it's nice. |
| 18:02:35 | brixen | evan: woot! |
| 18:02:36 | evan | guys, please take a spin around the debugger |
| 18:02:39 | evan | and tell me what sucks |
| 18:02:41 | evan | so I can fix it. |
| 18:02:46 | evan | step isn't there yet still |
| 18:02:50 | evan | thats what i'm doing next |
| 18:02:54 | sbryant | neat-o |
| 18:03:02 | brixen | evan: do we have some docs on that? |
| 18:03:05 | sbryant | I'll see if I have time to put our app on it. |
| 18:03:06 | evan | no |
| 18:03:10 | brixen | code samples I can make docs from? |
| 18:03:14 | evan | brixen: i'm working on that this week too |
| 18:03:18 | brixen | ok |
| 18:04:22 | jakedouglas | ok, so json 1.4.3 is just hosed? |
| 18:08:55 | dbussink | jakedouglas: i've thrown it out and went back to using 1.4.2 in our app |
| 18:08:59 | jakedouglas | ok. |
| 18:09:30 | dbussink | jakedouglas: i think it was something like this: http://github.com/flori/json/issues/issue/34 |
| 18:09:54 | jakedouglas | right. |
| 18:10:04 | dbussink | jakedouglas: and also http://github.com/flori/json/issues#issue/21 |
| 18:10:14 | dbussink | but flori doesn't seem to respond to anything |
| 18:10:22 | dbussink | evan: did you get in contact with him? |
| 18:10:28 | evan | nope |
| 18:10:30 | evan | no one has. |
| 18:10:41 | dbussink | jakedouglas: btw, did you talk to evan about that initialization issue you saw in json? |
| 18:11:05 | dbussink | evan: i saw the rubygems.org guys gave the jruby people access to put a gem up there |
| 18:11:40 | evan | yes |
| 18:11:41 | evan | i saw. |
| 18:13:47 | jakedouglas | evan: mind applying this to your json fork? http://gist.github.com/490955 |
| 18:13:54 | jakedouglas | (cc dbussink) |
| 18:14:06 | evan | sure |
| 18:14:19 | jakedouglas | thanks. it was blowing up rbx occasionally. |
| 18:15:09 | evan | ok, just pushed it. |
| 18:15:10 | dbussink | jakedouglas: does it allocate rbx management memory then? |
| 18:15:24 | jakedouglas | dbussink: sorry? |
| 18:15:41 | dbussink | jakedouglas: well, i was wondering about the rationale exactly behind it |
| 18:15:45 | dbussink | why it's needed |
| 18:15:55 | jakedouglas | i thought you were here when i explained it |
| 18:16:04 | jakedouglas | no> |
| 18:16:04 | jakedouglas | ? |
| 18:16:07 | dbussink | because there are plenty of other c gems that probably allocate memory |
| 18:16:30 | dbussink | i'd have to look it up again, don't remember the exact details anymore |
| 18:16:33 | brixen | hmm, 9 of 10 kernel panics occur while rbx is running specs, wish I knew enough to post mortem debug this |
| 18:16:56 | evan | brixen: O_o |
| 18:18:05 | jakedouglas | ok. the problem is that it's mark function calls rb_gc_mark_maybe with a bunch of it's struct fields. if the fields aren't zeroed out, and haven't been set to anything yet, the garbage memory sometimes appears as a CAPI handle to the gc and it tries to mark it and blows up |
| 18:18:22 | evan | ah |
| 18:18:30 | evan | MRI probably happily continues on |
| 18:18:37 | jakedouglas | specifically, it happens during it's initialize function |
| 18:18:38 | evan | just an edge case for rb_gc_mark_maybe |
| 18:18:40 | dbussink | jakedouglas: ah, wait, it wraps it in a Data_Wrap_struct |
| 18:18:53 | jakedouglas | it tries to allocate a new ruby object to assign to one of the fields, that triggers gc. |
| 18:20:51 | dbussink | jakedouglas: i was just wondering how that allocated memory was seen by the gc, so hence the question |
| 18:21:10 | jakedouglas | oh, yea sorry. |
| 18:21:59 | dbussink | evan: is this a fixable issue? i can imagine it happening with more gems |
| 18:22:10 | evan | no. |
| 18:22:19 | evan | if there is uninitailized memory |
| 18:22:24 | evan | then there is uninitialized memory. |
| 18:23:18 | evan | let me check the impl of mark_maybe |
| 18:23:29 | evan | ok yeah |
| 18:23:33 | evan | i was wrong |
| 18:23:41 | evan | we can be doing a fuckload better |
| 18:23:47 | evan | we never implemented mark_maybe properly |
| 18:23:50 | evan | it's just calls mark |
| 18:23:53 | evan | there is no condition. |
| 18:23:59 | jakedouglas | uh |
| 18:24:07 | jakedouglas | i thought i saw that it checks CAPI_REFERENCE_P() |
| 18:24:14 | evan | in mark, yes. |
| 18:24:19 | jakedouglas | oh. |
| 18:24:22 | evan | but that just checks the low bits |
| 18:24:27 | evan | to see if they're zeros |
| 18:24:37 | evan | not if the whole bit pattern points to a valid CAPI handle |
| 18:24:43 | jakedouglas | i see |
| 18:24:46 | evan | basically, we need to be looping through all handles |
| 18:24:57 | evan | and seeing if the the value passed in is a handle |
| 18:25:07 | evan | without deref'ing the passed in value |
| 18:26:51 | Defiler | brixen: it gets better: http://caselaw.findlaw.com/us-5th-circuit/1532338.html |
| 18:27:18 | Defiler | summary: DMCA just got curbstomped |
| 18:28:44 | jakedouglas | evan: where are the handles stored? |
| 18:29:18 | evan | jakedouglas: look in capi/handle.cpp and builtin/nativemethod.cpp |
| 18:29:21 | evan | for when handles are created. |
| 18:32:29 | dbussink | evan: any reason why Kernel.debugger isn't an alias for Debugger.here (if i look at that mspec commit) |
| 18:33:37 | evan | because i'm not ready for that. |
| 18:33:59 | evan | debugger is used by ruby-debug and such |
| 18:34:06 | evan | we need to figure out if we want to also use it |
| 18:34:15 | evan | and it's already missing some features |
| 18:34:27 | jakedouglas | evan: state->shared.global_handles() ? |
| 18:34:48 | evan | jakedouglas: yes. |
| 18:34:55 | jakedouglas | k. |
| 18:34:57 | evan | iterate over that and look for ptr |
| 18:35:02 | jakedouglas | k. |
| 18:35:20 | jakedouglas | should i do this in mark_maybe? or just mark? |
| 18:35:29 | evan | mark_maybe |
| 18:35:31 | jakedouglas | k. |
| 18:35:43 | evan | the best would be to abstract the question |
| 18:36:03 | evan | ie, add capi::Handle::valid_handle_p(STATE, capi::Handle* ptr) |
| 18:36:08 | evan | and then use it in mark_maybe |
| 18:36:19 | jakedouglas | ok |
| 18:38:11 | dbussink | evan: would that result in a significant performance impact for capi handles? |
| 18:38:15 | dbussink | during gc? |
| 18:38:38 | evan | yes |
| 18:38:42 | evan | thats why it only goes in mark_maybe |
| 18:38:45 | evan | which is rarely used. |
| 18:39:58 | dbussink | evan: hehe, first feature request for the debugger, a help command ;) |
| 18:40:11 | evan | there is one |
| 18:40:19 | evan | type help. |
| 18:40:28 | evan | oh me |
| 18:40:30 | evan | i thought there was... |
| 18:40:40 | dbussink | hehe, i can vaguely remember something too :) |
| 18:40:44 | dbussink | which is why i was surprised |
| 18:40:45 | evan | weird. |
| 18:40:51 | evan | ... |
| 18:40:54 | evan | where did that go? |
| 18:40:58 | evan | anyway |
| 18:40:59 | evan | yes. |
| 18:41:23 | evan | I need to reorganize it a little bit |
| 18:48:27 | boyscout | Pass the current block into an sclass. Fixes #425. - cad251e - Evan Phoenix |
| 18:52:38 | brixen | awesome, I did not realize that was possible |
| 18:52:47 | evan | no did I |
| 18:52:47 | brixen | evan: where is the code that used that? |
| 18:52:50 | evan | and i think it's stu.pid. |
| 18:52:51 | evan | stupid. |
| 18:52:53 | brixen | yeah |
| 18:53:00 | evan | because sclass is closed for locals |
| 18:53:07 | evan | i guess if you do a return in an sclass |
| 18:53:17 | evan | it's supposed to make the outer method return |
| 18:53:23 | brixen | huh |
| 18:53:26 | evan | so it's like a block |
| 18:53:35 | evan | again |
| 18:53:36 | evan | stupid. |
| 19:19:48 | boyscout | Validate StatiScopes in constant caches. Fixes #426. - 8afb7b4 - Evan Phoenix |
| 19:22:20 | jakedouglas | evan: how do i do the comparison? do i need to cast to intptr_t or something? |
| 19:23:10 | evan | you can do capi::Handle::from(ptr) |
| 19:23:23 | evan | which does a cast, it doesn't deref if |
| 19:23:25 | evan | so it's safe. |
| 19:28:29 | evan | ok, lunch time. |
| 19:32:39 | jakedouglas | i don't understand how to get a handle from an iterator |
| 19:35:36 | jakedouglas | ok maybe i do |
| 19:36:02 | jakedouglas | how do i compare the two handles? error: no match for ‘operator==’ in ‘i == ptr’ |
| 19:49:53 | JamesKilton | trying to understand the why of Issue 428... that's just weird |
| 20:45:43 | evan | jakedouglas: if(*i == capi::Handle::from(ptr)) |
| 20:46:10 | evan | i is an iterator, so operator* returns a reference to the current value |
| 20:49:07 | jakedouglas | http://gist.github.com/491217 |
| 20:49:09 | jakedouglas | what am i doing wrong there |
| 20:49:17 | jakedouglas | error: no match for ‘operator*’ in ‘*i’ |
| 20:50:04 | evan | oh oh |
| 20:50:05 | evan | ack. |
| 20:50:06 | evan | sorry. |
| 20:50:38 | jakedouglas | i grabbed that for loop out of nativemethod.cpp |
| 20:50:49 | evan | k |
| 20:51:16 | jakedouglas | what am i doing wrong? :( |
| 20:51:18 | evan | use i.current() |
| 20:51:27 | evan | i forgot that that code uses my own iterator |
| 20:51:27 | jakedouglas | ok |
| 20:51:32 | evan | not a STL iterator |
| 20:51:50 | jakedouglas | ah i see |
| 20:51:54 | jakedouglas | ok seems to build. thanks |
| 21:14:08 | jakedouglas | evan: can you tell me if this is OK? http://gist.github.com/491260 |
| 21:14:53 | evan | jakedouglas: yeah, looks good |
| 21:15:00 | jakedouglas | k |
| 21:16:07 | evan | jakedouglas: oh |
| 21:16:13 | evan | you need to check cached_handles also |
| 21:16:28 | bakkdoor | hey evan, i'm in OC now ;) |
| 21:16:31 | evan | globals_handles and cached_handles |
| 21:16:32 | jakedouglas | okay. can you explain the difference? |
| 21:17:06 | evan | jakedouglas: cached_handles are walked every transititon between capi code and normal code |
| 21:17:20 | evan | because they are handles for data that is cached and must be flushed |
| 21:17:36 | evan | we have the 2 lists because we don't want to have to check all handles each time |
| 21:17:47 | jakedouglas | hmm. i guess i dont understand enough about the handle system to really get it. thanks anyway :) |
| 21:18:06 | evan | for you, it's easy |
| 21:18:11 | evan | add another loop in valid_handle_p |
| 21:18:14 | jakedouglas | yea i know |
| 21:18:15 | evan | to check cached_handles also. |
| 21:18:16 | evan | k |
| 21:18:21 | jakedouglas | i just wanted to understand what they were |
| 21:18:25 | jakedouglas | that's all |
| 21:18:51 | evan | i gotcha. |
| 21:19:15 | jakedouglas | is it safe to use the same variable name 'i' for the iterator in the second loop? |
| 21:19:20 | evan | yep |
| 21:19:47 | jakedouglas | ok. should i check one of global_handles or cached_handles before the other because it would be more likely to reside in one of them/ |
| 21:20:00 | evan | nope |
| 21:20:09 | evan | doesn't matter |
| 21:20:14 | jakedouglas | k |
| 21:23:01 | brixen | um... http://lisp.dive2ent.com/ |
| 21:23:30 | brixen | matz tweeted that btw |
| 21:24:26 | brixen | I wish ragel had a REPL :) |
| 21:25:28 | evan | bakkdoor: hah |
| 21:25:29 | evan | er. |
| 21:25:30 | evan | brixen: hah |
| 21:25:58 | evan | bakkdoor: when you going to come up to LA? |
| 21:26:48 | bakkdoor | evan: whenever you have time ;) |
| 21:26:57 | bakkdoor | I'm pretty flexible |
| 21:27:42 | evan | i've got a normal week this week |
| 21:27:45 | evan | so pretty much anytime |
| 21:27:49 | bakkdoor | ok cool |
| 21:27:57 | tarcieri | lol brixen |
| 21:29:24 | jakedouglas | jvm langs is much less 'lang' oriented this year it seems. |
| 21:29:39 | evan | jakedouglas: are you there? |
| 21:29:44 | jakedouglas | yea. |
| 21:29:47 | evan | nice! |
| 21:30:03 | evan | they mainly discussing VM stuff? |
| 21:30:11 | jakedouglas | almost feeling guilty now for getting work to send me under the premise of learning about new languages |
| 21:30:11 | brixen | jakedouglas: are you our rbx proxy? :) |
| 21:30:11 | evan | i saw there was a presentation on register allocators |
| 21:30:13 | evan | O_o |
| 21:30:34 | brixen | jakedouglas: assembly is a language too :) |
| 21:30:59 | jakedouglas | yea. there was nutter with mirah, some java thing, some other java thing, the register allocator thing |
| 21:31:11 | jakedouglas | then there was a jvm coroutines talk which made me feel less dumb |
| 21:31:56 | jakedouglas | brixen: the current talk is the first one showing assembly. which i actually understand, unlike the java stuff :p |
| 21:32:55 | evan | jakedouglas: no scala or clojure talks? |
| 21:33:01 | boyscout | Check the handle against our known set of handles before marking in rb_gc_mark_maybe() - 22c4325 - Jake Douglas |
| 21:33:12 | jakedouglas | it looks like most of the actual talks about languages are on day 3 |
| 21:34:46 | jakedouglas | i see groovy, scala, kawa, scala, fortress, erjang |
| 21:35:08 | evan | oh nice, kresten is there |
| 21:35:22 | evan | are they taping it? |
| 21:35:28 | jakedouglas | yea and yea |
| 21:37:02 | jakedouglas | there was an interesting time-traveling debugger too |
| 21:37:27 | evan | nice. |
| 21:37:43 | jakedouglas | i guess its 'workshops' for the rest of the day |
| 21:38:02 | jakedouglas | where i lay low and dont let on that im clueless about all this stuff |
| 21:38:29 | jakedouglas | these guys are another breed, for sure. |
| 21:38:39 | jakedouglas | :p |
| 21:38:47 | brixen | jakedouglas: hah, just consider it a wonderful opportunity to find out how much there is to learn :) |
| 21:38:58 | jakedouglas | that's why i'm here :) |
| 21:39:13 | brixen | evan: I'm going to a hack session on thurs where we are supposed to play with Rakudo * Perl compiler |
| 21:39:26 | evan | sounds fun! |
| 21:39:36 | brixen | I'm trying to get someone who knows perl to pair with me on getting it to emit rbx bytecode for a simple perl snippet :) |
| 21:39:48 | evan | :D |
| 21:40:23 | brixen | sounds like the Parrot rewrite might be pretty interesting |
| 21:40:41 | brixen | but perhaps rbx is Perl6's best shot at usability in the near term :) |
| 21:40:46 | evan | hah |
| 21:40:56 | evan | I saw it's wiki pages |
| 21:40:57 | slava | brixen: the last 5 parrot rewrites were pretty interesteing too |
| 21:41:03 | brixen | slava: heh |
| 21:41:08 | evan | what worries me most is the lack of pragmatism, i guess. |
| 21:41:24 | evan | they talk a lot about basically, "getting it right" before they start |
| 21:41:42 | brixen | yeah, that's pretty hard to do |
| 21:41:50 | brixen | as they have demonstrated :D |
| 21:41:58 | evan | hey, so have we! |
| 21:42:19 | brixen | I don't think we try to "get it right" before we start |
| 21:42:36 | evan | my natural pessimism/pragmatism seems to have done us well |
| 21:42:40 | brixen | yep |
| 21:42:48 | evan | oh, I don't mean we tried |
| 21:42:54 | brixen | right |
| 21:43:01 | evan | i mean that it's wrong and we've gotten it wrong a few times |
| 21:43:03 | evan | er. |
| 21:43:04 | evan | it's hard. |
| 21:43:06 | brixen | yep |
| 21:48:35 | evan | well, I wish them well |
| 21:49:18 | evan | the "lets rewrite everything in a new language on top of our new VM set" sounds like a great time suck. |
| 21:49:27 | slava | worked for me :) |
| 21:49:35 | evan | :D |
| 21:50:50 | BrianRice-work | I don't know if the perl6 rewrite news shocks me more or the reasons stated why they're doing the rewrite |
| 21:51:03 | BrianRice-work | s/perl6/parrot/ |
| 21:51:25 | evan | which reasons? |
| 21:51:34 | BrianRice-work | something about too many opcodes, for one |
| 21:51:58 | BrianRice-work | (hit and run, bbiab) |
| 21:52:10 | blowmage | BrianRice-work: url? |
| 21:52:35 | evan | well, thats true from what I understand |
| 21:52:40 | evan | parrot has thousands of opcodes |
| 21:52:46 | evan | which doesn't seem wise to me. |
| 22:04:18 | dbussink | evan: this was that parrot rewrite: http://trac.parrot.org/parrot/wiki/Lorito |
| 22:04:26 | evan | yep |
| 22:13:03 | dbussink | jakedouglas: is your app still showing issue #411? |
| 22:13:16 | dbussink | because i've repro'd it too, no idea where it comes from though |
| 22:14:51 | jakedouglas | yea, last time i was trying to run that codebase against rbx it happened every single time. |
| 22:15:00 | jakedouglas | i never made any progress on it though, beyond what's in the ticket. |
| 22:16:34 | dbussink | jakedouglas: yeah, i tried to extract the snipped where the error occurs, but stand alone it worked |
| 22:17:28 | dbussink | evan: could it be that your fixes also fixed #428? because that works for me now |
| 22:17:51 | evan | lets see.. |
| 22:18:18 | evan | 428 happens to work |
| 22:18:22 | evan | but not in the proper way |
| 22:18:34 | evan | if you put a 'return 2' after the 'end' of 'class <<' |
| 22:18:36 | evan | you'll get 2 |
| 22:18:37 | evan | instead of 1 |
| 22:18:49 | evan | as for 411 |
| 22:18:53 | evan | i don't know how it would be related. |
| 22:19:44 | dbussink | evan: 411 isn't related to this, just wanted to know if jakedouglas still sees it |
| 22:19:55 | evan | ah. |
| 22:20:20 | evan | irc needs <hr> |
| 22:21:17 | dbussink | google wave can do threaded chats :P |
| 22:21:46 | dbussink | but anyway, night time! |
| 22:22:13 | evan | nite! |
| 22:23:16 | jakedouglas | nite nite |
| 22:23:28 | dbussink | evan: added a comment to 428 so it's not forgotten |
| 22:24:44 | brixen | dbussink: sleep tight! I might have bm results for you on chunky_png when you awake :) |
| 22:24:58 | evan | dbussink: why would it be forgotten? |
| 22:26:25 | dbussink | evan: well, you're the one always talking about writing things down in issues ;) |
| 22:26:33 | evan | ok |
| 22:26:33 | evan | :) |
| 22:26:43 | evan | i thought you meant the whole issue would be forgotten |
| 22:26:44 | dbussink | evan: because the code in the issue currently works and maybe otherwise i'd close it in some cleanup spree :) |
| 22:27:00 | dbussink | brixen: ah ok, cool, curious to see them :) |
| 22:28:28 | dbussink | but anyway, sleep time! |
| 23:58:51 | evan | the thing I like least about debuggers is that when they show the current line and you hit "step" |
| 23:59:00 | evan | at some point, you return to that same line |
| 23:59:16 | evan | with barely a clue that you're past the first method call on that line, able to step to the next |