Index

Show enters and exits. Hide enters and exits.

02:15:27headiushttp://jira.codehaus.org/browse/JRUBY-3714
02:15:30headiusrbx fails it too
02:15:33headiusstupid cvars
02:16:37rueWell, technically we have a 2:1 advantage over MRI then ;)
02:17:11devinusis there a daily benchmarker like pypy has? i'm really beginning to dig rubinius and most every package i throw at it is working now, i just wish i could see some hard data somewhere
02:17:25headiusrue: time to gang up!
02:18:53ruedevinus_: Which data?
02:19:25devinusrue: some type of graph or table benchmarking MRI and rubinius
02:20:06devinusrue: something akin to http://tuatara.cs.uni-duesseldorf.de/benchmark.html
02:20:16rueNeed to find something to benchmark, then, other than the specs
02:21:32slavahow about the shootout benchmarks?
02:23:27sandalevan, brixen, rue : Terribly crappy mockup of my RubySpec idea
02:23:29sandalhttp://is.gd/IDOO
02:24:22rueMm, the shootouts might work, although some real apps would be better
02:31:07sandaldevinus_: feel free to run Prawn's example set
02:31:24sandalRubinius does it perfectly, and it should hit a wide range of Ruby features
02:58:35rueHeh
02:58:52rueRunning the specs multiple times in the same run does not work so good
03:40:01rueWell, running some library code, about 3.5x the time 1.8.7 is taking
03:40:25rueCore code is more like 5.5-6x
03:44:04slavasounds like you have some catching up to do :)
03:44:25slavawhen you're 10x faster than MRI I'll buy you all a big case of beer
03:52:03rueJIT is not making much of a difference...and the specs collapse before enough code can be run to determine if really aggressive inlining helps any more
03:54:00slavarue: more work on the JIT should give you a speedup even without type feedback
03:54:15slavathe V8 and SFX guys just riced the fuck out of the JITted forms of various bytecodes and got good speedups
03:54:24slavaeg, you can do a fastpath for arithmetic ops so that the fixnum case is inline
03:54:27slavanot sure if evan did this yet or not
04:06:17rueDun think so
04:06:32rueI am sure there are plenty of low hangers
04:07:29rueRight now the plain JIT is about a 13% reduction over a full spec run
04:13:43ddubspeedups are so overrated
04:33:21devinusslava: i know your name somewhere. :-) Slava Pestov?
04:48:52sandalevan: so, does this look interesting? http://is.gd/IDOO
04:48:56sandal(if ugly)
04:49:31sandalsweet. It will definitely happen. I'll at least try, anyway
04:49:43sandalMy work is talking about maybe even pulling our designer in on this
04:50:22sandal<shrugs> I really don't know.
04:50:39sandalI sort of need to data drive the UI, and I need to get familiar with the data first
04:50:55sandalIt'd be nice to see both a class and method level spec
04:51:16sandalthe class level report might be abridged
04:51:32sandalto show what functions have specs and what is missing
04:51:45sandaland then clicking through would give you this method-level view
04:52:18sandalbut this is why I asked my work to get involved. It's not so much the paid time that will help (as that'll be a few hours per week, tops), it's the fact that they will volunteer hours
04:52:39sandalI don't really do any of this web stuff, I mostly hack on building backend support
04:52:58sandalYeah, I will probably start with something much lighter than this and see where it takes me
04:53:13sandaland hopefully progress to something more featureful than the mockup
04:53:47sandalI've been itching to do something that's challenging but stands to help the Ruby community at large
04:53:51sandalthis seems like a good project for that
04:55:19sandalit also seems like something that you, and headius, and all the other implementers would be doing yourselves if you didn't have so much work to do already
04:55:54sandalI think it might be a good idea to have a layperson try to bring together all this awesome work you guys are doing.
05:22:59sandalahaha, reading the 1.8.7 NEWS file is sort of like reading an April fools joke
06:05:52ddubevan: I think you might want to reword this
06:05:57ddubit gives the impression that rubinius isn't dead
06:05:59ddub;-)
06:07:09headiusharsh
06:07:30headiusI thought I was the only one mean enough to make that joke
06:08:40ddubheadius: is it still mean if I put a ;-) after it?
06:09:02headiusI think it becomes black comedy then
06:09:18ddubbut yeah evan, more communication is always good, and it reads fine to me
06:10:19ddubdon't worry headius, as soon as I think of a good rude comment re: java + ruby + oracle, you will be first to know
06:10:33headiusI've heard most of them, so you'll have to dig deep
06:10:42ddubany good ones?
06:10:47ddubI've had a tough time coming up with anything
06:11:17headiusmostly people just trying to take down jruby by insulting sun's dumb decisions
06:12:31scooprwhen you introduce yourself, would you insist that you work for sun, or confess that you work for oracle? ;)
06:12:44ddubyeah, but thats easy. I'm trying to figure out how to work oracle into the mix
06:13:38ddubI still like jwz and his interview comment about his friends ridiculing him for his new jwz@aol.com email address
06:14:08ddubapparently that wasn't appreciated by all of his new management after the netscape acquisition
06:14:29headiusI've started to use my headius.com email for most things, if that tells ya something
06:14:38ddubso larry ellison, matz, and duke walk into a bar...
06:15:24ddubI've always thought duke would sound like a cross between alvin and the chipmunks and john wayne
06:15:59ddubit leaves me a large area to work within :)
06:16:29ddubbut I mean more like, john wayne two octaves higher
06:17:42ddubheadius: the way I figure it, I like java except for the language and the standard libraries...
06:17:57ddubso since jruby keeps me from having to deal with those, hoorah :)
06:18:29headiushey, we aim to please
06:19:03headiusif someone can use jruby and never know they're using java, that's a good day
06:21:50sandalif I document this change in RubySpec, where should it go?
06:21:51sandalhttp://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/337791
06:22:02sandallanguage/array_spec.rb ?
06:22:27sandalwhere is that?
06:22:54sandalah, element_set_spec.
06:23:00sandalDidn't know that was the name for that :)
06:23:16sandalagreed
06:23:20sandalthough I might call it
06:23:24sandalbracket_equals_spec
06:23:38sandalNot because that sounds good, but because I'd recognize it immediately
06:23:48headiusit's called "aset" in jruby
06:23:53headiusor op_aset
06:24:35headiusI think jruby's compiler mangling turns it into leftbracket_rightbracket_equals
06:25:25sandaloh hmm, I think it's already specified.
06:27:50sandalyep:
06:27:51sandalhttp://pastie.org/493649
06:28:20sandalcool, I don't need to do any work then :)
06:28:40sandalBut I'm already wishing for my web interface.
06:29:00sandalUser types in Array#[], sees the list of spec names, and which versions do what clearly in a list.
06:29:34sandal#[]= err
06:32:01sandalHonestly, I'm just amazed at what an awesome resource these specs are.
06:32:12sandalYou guys have done a terrible job of getting them appreciated ;)
15:48:06ruesandal: Heh, I see Matz actually read the question this time :)
15:48:15rueDid not respond to my query, though...
15:48:29sandalrue: hah, his response makes more sense now, though
15:48:45rueheadius: Would you be of the opinion that Rubinius is not allowed to rely on Module#name being correct?
15:49:32headiusrue: yes
15:49:41rueI am not in favour of any kind of _actual_ prevention, I think...just decreeing that if the user fucks with Core methods/ivars, they do so at their own risk
15:49:48headiusjust last night I found another class that defined its name as something weird
15:50:07rueheadius: But not its *real* name, right?
15:50:17headiusit should probably be expected that people are overloading Class#name and Module#name for other purposes
15:50:26headiuswell, it's Class#name
15:50:29headiusits
15:50:57rueBut then I think there should be some alternative mechanism for getting the real name...I do not see the point of Module#name if it is not inviolable
15:51:25sandalis there any reason why FFI presents things in a different order than what's natural in C?
15:51:36sandalI sort of would like to be able to do
15:51:50ruesandal: Ha! I wrote an alternative API for a C-like declaration but was shot down..
15:52:21sandalffi_build_interface { f.int :MyFunc, [:int, :string, :int]; f.string :MyFunc2 }
15:52:39sandal|f|
15:52:48headiusmost things could be added atop what's there now, so it's worth proposing
15:52:57headiusor release an ffi_builder gem :)
15:53:04sandalSure, I know it's easy to add, just wanted to see if you liked it :)
15:53:39ruehttp://github.com/evanphx/rubinius/commit/3be9a9143961ecd48f7c4e6c017197f98a485977
15:54:16headiusif it were instance_eval'ed (I know, boo hiss) it could be { int :my_func, [int, string, int]; string my_func2 }
15:54:39sandalheadius: I would probably do what I did with Prawn
15:54:48sandalwithout block arg, instance eval
15:54:55sandalwith, normal closure and param passing
15:55:20rue`attach_foreign :int, 'foo', [:string, :string]` or something, I think it was
15:55:25headiusthe other option would be to get a full-featured C signature parser and just do ffi_blah "int my_func(char*, uint)"
15:55:42headiuswhere the signature is defined in terms of FFI type names
15:56:07rueNah...although assuming a subset of valid C it is pretty simple
15:56:17rueI like the pseudo-C better still :)
15:56:56sandalI could give it a really overblown name for a 10 line gem
15:56:57sandalsexy_ffi
15:57:06ruesandal: cexy_ffi
15:57:12sandalahaha
15:57:16headiussecksy
15:57:53sandalhttp://gist.github.com/119989
15:57:54headiusother than rubygems sucking I am totally in favor of lots of tiny gems to build APIs on top of APIs
15:58:10headiussucking = excessive nonsense on require 'rubygems' every time
15:58:12sandalJust toying with syntax here using a small sample of my real FFI code
15:58:26sandala DSL could also give you something like
15:58:47sandalptr = memory_pointer(type)
15:58:59rueBut I think overall it would just lead to undue multiplication...I would probably prefer to just use the standard version even if it sucks ;)
15:59:18sandalWell I'm thinking this is something I can whip up on a gist
15:59:20headiussandal: you should try to start up a conversation on ffi list at any rate
15:59:33headiusheh, there needs to be a way to have a gist auto-gemify
15:59:35sandalSure, let me try building it and see how it improves my code
15:59:45sandaland then if it's convincing I'll provide a before and after
15:59:46headiuslike a gist with a .gemspec file
16:01:29rueheadius: Haha, that is a horrifying idea
16:01:37rue"Release a Gem of this Gist"
16:01:40headius:)
16:01:56headiusit seems like the GitHub Way
16:01:58rueAnother GSoC project for next year...
16:03:41sandalevolving this idea a little...
16:03:43sandalhttp://gist.github.com/119989
16:05:00ruesandal: The thing that most bothers me personally about the current API is defining the alternate name
16:05:08sandaloh
16:05:12sandalin this API it could just be
16:05:20rueI used `:as => "someothername"` with .attach_foreign
16:05:25sandal{ :OldName => :NewName }
16:05:31sandalor sure
16:05:42sandalfunc, args, :as => "Other"
16:06:03sandalI'll try both of those and see how it goes
16:06:50rueI do like the block form for the lib rather than setting the lib without apparent scope
16:14:52sandalI'd probably build this on top of something like class MyClass < FFI::Builder; end
16:15:22sandalSo that there is a less magic way to get at it, and it's all self contained
16:15:57rueIn addition to defining the lib, I would see about just getting it in ruby-ffi
16:16:48sandalSure, I'll try that before releasing anything of my own, it's just good manners
16:17:00sandalHah, this is so funny.
16:17:11sandalThe easiest way to access a C library from Ruby on Windows is JRuby
16:17:25sandalI don't know whether that's hilarious or sad or both
16:41:15ddubsandal: I vote both
17:13:39brixensandal: I think you will want to stick with a mixin rather than inheritance for that
17:13:52brixenMyClass is not really an FFI::Builder
17:14:11brixenunless you plan on making a variant of FFI::Builder
17:14:56brixensandal: one reason it works the way it does is because we attach FFI functions very early in our bootstrap process
17:15:05brixenthe simpler the code, the better
17:15:19brixenwhich doesn't mean you can't have a fancy mechanism
17:15:29brixenbut we won't use it in core lib
17:18:35headiusevan: I was going to show you the invokedynamic bytecode the other day, but realized it was pretty trivial
17:18:38headius INVOKEDYNAMIC java/lang/dyn/Dynamic.fcall (Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/ IRubyObject;Ljava/lang/String;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRu byObject;
17:18:57slavathat's so dynamic
17:19:17sandalbrixen: oh sorry, I didn't know FFI builder existed
17:19:41headiusfcall there is just being used as a marker to know which kind of call it is; I assume all indy ops pass the method name to invoke as an argument
17:19:45headius(atm)
17:20:06headiusit also allows me to install call site logic that doesn't do visibility checks, etc
17:20:17headiusslava: it is!
17:22:10slavaI wonder how much better hotspot would be if they could get rid of a lot of the legacy stuff, like the bytecode, and just expose the IR directly
17:22:43brixensandal: I don't know about FFI builder, I was just commenting on this..
17:22:44brixen08:14 sandal >> I'd probably build this on top of something like class MyClass < FFI::Builder; end
17:24:56headiusslava: well, I'm hoping that the methodhandle stuff gets us part of the way there
17:25:36cremesis it still true that java classes can't inherit from jruby classes?
17:25:58headiusnot without ruby2java, which is still early prototype
17:26:13headiusI'm still not exactly sure what it means to extend a static type from a dynamic type though
17:26:33cremestrue...
17:26:44headiuser, extend a dynamic type from a static type, I guess
17:27:02cremesi build most of my classes using modules; i have a class that needs java performance but i'd like it to be able to "include" the ruby parent stuff
17:27:39cremesiow, i only want to write the performance critical subclass in java while the inherited bits remain in ruby
17:28:07slavasounds like you should go for a more traditional compositional design rather htan using inheritance here
17:28:27cremesnot really doable unless i forward/delegate calls from the ruby subclass to the java subclass
17:28:34cremesyeah, compositional
17:28:55cremesi'll go that route for now since it is quickest
17:30:15headiuscremes: it will be possible in the future
17:30:27cremesmost excellent!
17:30:40headiusgetting ruby2java shaped up is up for the summer, which would then give you a way to have a "real" Java type to extend
17:30:50headiusbut we should probably move this to #jruby for further discussion :)
17:30:58eneboreally :)
17:31:12cremesoops, i thought i was in that channel! :)
17:47:31sandalbrixen: yeah, I recognize that problem. It wouldn't be too hard to do something like this
17:48:16sandalCreate a module for mixin
17:48:21sandaland maybe automatically mix it in
17:48:46sandalbut this really would just be for lazy people. :)
17:48:55sandalI'm not necessarily suggesting it for core
17:49:15sandalit could be something like
17:49:27sandalAPI = ffi_builder() { ... }; include API
17:49:40sandalI'll have to play with it and see how it goes
17:59:09ruesandal: Do you have perf numbers for running the Prawn examples under Rubinius (in contrast with MRI)?
18:03:16sandalI will get them soon, I'm writing that part of my pres now
18:03:29rueCool
18:03:42rueOh, yeah, the conf is tomorrow, right?
18:03:47sandalman, I hope the people like this picture of an old rusty truck
18:03:56sandalBecause I show it whenever i talk about MRI
18:04:00sandaland I talk about MRI a lot
18:04:07rueIf you can do a profile run, too, 't helps
18:04:24brixensandal: maybe slice the pic up and show different parts
18:04:29sandalI definitely don't want to get involved in performance analysis
18:04:39brixenbuild up to the full pic of the rusty truck :)
18:04:41sandalOtherwise people will throw tomatos
18:04:51headiusugh test perf numbers
18:05:03rueheadius: No, *example* perf numbers
18:05:04headiusthe worst possible test of runtime-optimizing vms
18:05:12sandalbrixen: holy cow, I wish I thought of that.
18:05:13headiussame diff
18:05:19rueUm, no
18:05:19sandalIt'd be too hard to work it in now
18:05:20brixensandal: a simple 'time command' is a good number to know though
18:05:27brixenmost of the perf stuff is gaming
18:05:28sandalbrixen: I've got that
18:05:32sandalThat's what I'm reporting
18:05:33brixenit's hard to game a time command
18:05:41sandaltime to run all the examples across implementations
18:05:46sandalthere are a lot of them
18:05:51ruesandal: To be clear, I am not suggesting you include that in your presentation :) Just in general
18:06:08sandalrue: feel free to grab Prawn's source and profile it
18:06:15sandaland if you find anything interesting, let me know :)
18:06:30rueHrm, I wanted you to do all the work
18:06:36rueGem OK?
18:06:43sandalbrixen: I really, really want to avoid lying to the audience. This talk came out way different as a result of sticking to my guns on that
18:06:57brixensandal: beautiful :)
18:06:58sandalI gem unpacked 0.4.1 for this test
18:07:25sandalIt's really hard. I would have needed to research this for a year to give people solid numbers and compatibility notes, etc
18:07:46sandalSo instead I'm trying to present what it's like to get your feet wet (good and bad), in hopes others will do it as well
18:08:04brixenvery cool
18:08:14sandalI just hope that message is appreciated
18:08:28sandalPeople tend to prefer graphs and statistics and demo-driven examples :)
18:08:45brixenbe true to your message and those that appreciate it are your audience ;)
18:10:16sandalI think the key thing that I discovered is that defining Ruby is really hard right now based on what we have out there, and because of that, it's hard to make decisions
18:10:51sandalSo I think that outside of the core community of implementers, the thing every Ruby hacker could do is try to help form that definition by learning more about the state of things
18:10:51slavado you think ruby is headed down the same road as common lisp, with multiple incompatible implementations and lots of per-implementation porting work?
18:11:10brixenslava: we're trying to ensure that doesn't happen
18:11:12sandalslava: that's my fear. It may well be inevitable
18:11:24sandalBut I don't want it to happen by surprise, or by accident
18:11:25brixenif it happens despite our best effort, perhaps it was inevitable
18:11:39brixenI don't think it's so hard to be compatible
18:11:58sandalbrixen: I don't want to keep sniffing vapor, but I really think a user accessible rubyspec will make a big difference
18:11:59headiusit's not
18:12:11sandalI'm just going to need a lot of help from you guys to make that work right
18:12:13headiusit's hard to define ruby when impls start "extending" it though
18:12:13brixenno one has anything to gain by making the ruby pool smaller
18:12:41sandalheh, why do I not feel the love of MacRuby among Rubinius/JRuby devs? ;)
18:12:43brixensandal: I like your proto interface
18:13:02headiushey, I didn't say anything about MacRuby! :)
18:13:03brixenI'm excited for macruby
18:13:09headiusyeah, me too
18:13:10brixenI can't wait
18:13:18brixenI used to write desktop apps
18:13:32brixenI'd have loved to write them in ruby rather than C
18:13:39headiusI just have a certain view of ruby purity that up to now all implementers have held sacred
18:14:10brixenbtw, macruby has a rubyspec evangelist too, his nick is alloy
18:14:16brixenand we should support/help him
18:14:23sandalFor sure.
18:14:40brixenhe's having beers in the sun right now :)
18:14:42headiusbrixen: you should post something about ffi => rubyspec on ruby-ffi mailing list
18:14:44brixen(he told me so)
18:14:45sandalI think the thing that's bugging me about MacRuby is the hype
18:15:01headiusI know we'd talked about it briefly but I don't think wmeissner knows anything abou tit
18:15:05sandalI actually think that the *lack* of hype about JRuby really is what kept it lean
18:15:08brixenheadius: yeah, I will, but I haven't started looking at it in detail yet
18:15:09sandaland impressive
18:15:47headiusbrixen: ok, I wasn't sure how far along it was, and then alloy posted to macruby list about it
18:15:51headiuskinda caught me off guard
18:16:23headiussandal: all impls get this sort of excitement early on...I think it will pass when it takes them more than a few months to get it done
18:16:35headiusthe roar about rubinius last spring was practically deafening :)
18:16:41sandalyeah, I was thinking about that....
18:16:45brixenheadius: yeah, the last convo with you and wmeissner ended without a clear plan
18:16:57sandalMacRuby at this point really reminds me of JRuby a couple years ago
18:17:02brixenheadius: you, me, and wmeissner I mean
18:17:11headiusbrixen: yeah
18:17:16sandalthere is so much promise there, but it's hard to see if you're not right at the center, unless you just trust the noise
18:17:44evanmorning.
18:17:53brixenmorning
18:18:01headiussandal: I was initially insecure about macruby because of two things: 1. I didn't know how they were getting their performance on the new branch, and 2. I thought they were a lot further along on compatibility
18:18:24rueEvening
18:18:25headiusnow I know where there perf comes from and I think I know how far it will take them, and I know they've just started to scratch the surface of rubyspec
18:18:38sandalheadius: I feel like 0.4 compat is smoke and mirrors
18:18:48rueheadius: Well, I am sorry, but the merbist article contradicts you so you lose ;)
18:18:53sandalSince it's still basically YARV
18:19:02headiusrue: I hear it will be 5x faster than C
18:19:02sandaleven if it has been gutted to run on ObjC
18:19:12sandalA million times faster than FORTRAN
18:19:14headiussandal: yeah, I think it was really accidental compatibility
18:19:34headiusI know from experience it gets harder and harder as you go too
18:19:52headiusgetting String#[] basically working is easy
18:19:53sandalThough, it is really sort of cool that if someone wanted to build a desktop app that pooped out a PDF, it'd be really easy to do with Prawn
18:19:57ruesandal: Were the M17N examples running for you?
18:20:04headiussandal: Write Once, Run Anywhere!
18:20:22sandalrue: yes.
18:21:16sandalbut probably not sjis, just run rake examples
18:22:09rueOn Rubinius, getting an invalid UTF-8 error
18:22:53evanheadius: have you tried using $1 on macruby experimental?
18:22:56rueIn the chinese, specifically
18:22:56evani wonder if it works
18:23:14headiusno, but I tried backref...it's still global
18:23:32sandalrue: I'll check it
18:24:17headiusyep, still global, a field on RoxorVM
18:24:40headiusthat's the sort of thing they're going to try to fix at some point and say "oh, darn"
18:25:01sandalrue: no problems
18:25:01headiusI know I've said it several times
18:25:04sandalon prawn-0.4.1
18:25:20sandal$ rbx -v
18:25:20sandalrubinius 0.11.0-dev (ruby 1.8.6) (1ef0d03be 12/31/2009) [i686-apple-darwin9.6.0]
18:25:42sandalBut I just built this from github on master
18:25:55tilmanheadius: hah, i thought you were poking fun at them when you mentioned roxorvm, before i hit google :]
18:26:05evanheadius: you think they'll say "oh darn" and just never fix it?
18:26:13evanbecause they'll run into a lot of troubles
18:26:16evanrunning code
18:26:44sandalrue: built from: 080585... Teach JIT properly about all manner of argument passing
18:26:44headiusevan: they can't avoid it, I guarantee
18:26:57headiusthere's way too many string and regexp methods that pass information via $~ and code out there that expects it
18:28:45evanyep
18:28:49evanwe hit it early and often
18:28:58evanbecause there is some kernel code that depends on it's behavior
18:29:00evanas I recall
18:30:02rueMm. About 9x
18:31:46evanslava: poke
18:31:53rueOn the upside, our startup time is less than JRuby's :)
18:32:00slavaevan: hi
18:32:36evanslava: whats the code path for calling a quotation look like?
18:32:46evanthere is a data structure around a quotation, yes?
18:33:11rueWell, actually, I lie, startup time + doing a glob and a loop
18:33:11slavaevan: it jumps to the machine code stored at the address in the 'xt' slot
18:33:24slavaevan: if it hasn't been compiled yet, this slot points at the vm function which compiles it and patches the xt
18:33:28evanwanna point me to the place where that happens in the code?
18:33:44slavathe actual call?
18:34:04slavabasis/cpu/x86/bootstrap.factor line 248
18:34:09slavaits not very interesting, just a handful of insns
18:34:43slavaremember that most quotations are optimized out completely so this is only used for the handful of 'dynamic' ones that remain at run time
18:35:25evansure
18:35:54slavaare you implementing JIT support for blocks?
18:36:07evanyep
18:36:14slavaso every block will cache its machine code?
18:36:23evanyeah
18:36:32slavabtw there is an associated data structure, every quotation has an array; its used for compiling and printing
18:36:36evani recently refactored BlockEnvironment so there is a function pointer it stores
18:36:44evanwhich is called to do the work
18:36:45slavathat sounds reasonable
18:36:49slavawhat's the calling convention?
18:36:54evanright now, that always points to one that runs it in the interpreter
18:37:07evanso just need to have that one keep a call count
18:37:15evanand do a substitution
18:37:25evancall convention is simple
18:37:28slavayeah, that sounds reasonable
18:37:31evanC style
18:37:37evanalways with 4 arguments
18:37:40slavawhen I do a dynamic quotation call, I put the quotation in EAX
18:37:49rueHih, a profile run is "slightly" slower
18:37:54slavacompiled quotations ignore EAX (they don't need a pointer to themselves) but if the xt is a pointer to the shared 'compile me' stub, it looks at EAX
18:38:03evanslava: gotcha
18:38:09evanyeah, i haven't gotten that low yet
18:38:10evansoon though.
18:38:21evanthere is still too much code between 2 JITd functions
18:38:48evanhm, i could play with implementing my own call convention in LLVM
18:38:53evanthat is actually supported
18:38:54evan:D
18:38:58slavaI also have some dynamic type checking; the (call) primitive defined in bootstrap is not called directly, the user uses the call word which won't crash if you pass a string for example
18:39:08slavaEAX is just the first argument for fastcall functions on x86
18:39:24slavaso its just void lazy_jit_compile(cell quot);
18:39:49slavaalso in some cases dynamic calls have to check that the quotation's stack effect is what you want; so it can get quote expensive too
18:40:02slavathe ruby equivalent would be checking if a block has the right number of args
18:40:06slavayou can optimize it out sometimes
18:40:30evanyep
18:40:36evani actually did that recently
18:40:47evanthere is an Arguments object that is passed down
18:40:49sandalUt oh, I think I've been spreading some lies about Prawns examples :-/
18:40:53slavaor if the block is literal, inline the body of the bloc at the call site; this is what eliminates 90% of quotations at run time for me
18:41:00evanand 4 bytecodes that are emitted to handle blocks args
18:41:34evanslava: you inline them since the compiler can see what the person they're passed to is doing with them, yes?
18:41:34slavayou probably can't do this until you have type feedback
18:41:50slavaevan: I just let the user declare words 'inline' explicitly because I'm cheap
18:41:59evan[ blah ] 100 times
18:42:02evanfor instance
18:42:08slavaand times has an inline declaration
18:42:18evanwhat if it doesn't?
18:42:19ruesandal: What'cha find?
18:42:20slavaits early-bound
18:42:27slavaevan: if it doesn't, then it uses the dynamic quotation calling sequence
18:42:31evanah!
18:42:33sandalan embarassing mistake, let me check
18:42:33slavawhich entails a check and an indirect jump
18:42:38evanso you're doing inlining based on pragma
18:42:42slavayes
18:43:46evanslava: so, do users of libraries mark their functions as inline?
18:44:04slavagenerally only those that take quotation parameters
18:45:03slavaevan: this optimization is pretty essential since even 'if' is implemented as a higher-order function, as well as all loops, etc
18:45:17slavait would really suck if everything had to check and indirect jump all the time
18:45:48evanoh sure
18:45:51evanjust curious
18:45:51slavaevan: in the Joy language, quotations are lists, there's no inlining, and everything is interpreted; the interpeter just traverses these lists
18:45:59slavaI used to think it was impossible to implement this model efficiently
18:46:10slavaturns out its possible, but there's a few compromises along the way that have to be made
18:46:54sandalrue: I need to re-run the whole prawntest
18:47:06sandalTurns out using backticks in rake files and forgetting about that is evil
18:47:08evanslava: interesting
18:47:22sandalThe good news, Rubinius does render all the examples perfectly
18:47:24evanslava: don't tell me nothing was running for rubinius :/
18:47:28evaner.
18:47:28sandalthe bad news, is it took 139s
18:47:32evansandal: ^^
18:47:47sandalwhere I get times around 15s on MRI
18:47:48evansandal: well, thats not outside the realm of possibility
18:47:51evansure
18:47:59sandalSure, I think it's what I would have initially expected
18:48:02evanwe know people are getting resuls like that
18:48:09evanwe're working hard to fix that.
18:48:17sandalBut I didn't know by what magic Rubinius was getting around to the same speed of MRI
18:48:22sandalwhen I was testing earlier
18:48:39sandalit was misleading because my tests were getting run through right
18:48:55evanwere they doing `ruby ... `
18:48:59sandalHahaha, yes
18:49:02evanhah
18:49:04evanah well
18:49:09sandalfacepalms
18:49:09evanat least you caught it now
18:49:19sandalRight, I think people would call bullshit if I said
18:49:27slavaevan: so dynamic quotations get compiled with the shit compiler, and words do too initially, during bootstrap the real compiler is loaded and it replaces the word compilation hook with the non-shit compiler hook
18:49:34sandal"Amazingly Prawn runs as fast MRI on Rubinius"
18:49:49sandalI should have done that myself, I just wasn't thinking about the times earlier
18:49:52sandalat all
18:49:56evansandal: yes, so long as in rubinius, it's
18:50:02evanexec "ruby", *ARGV
18:50:05sandalI've been in a haze the last couple days.
18:50:35sandalyeah, I thought I had used something safer for running those files
18:50:36evanslava: so dynamic quotations are always slow?
18:50:45sandalanyway, headius now I'll find out if I have good or bad news for you :)
18:50:56slavaevan: relatively speaking, yeah. any words they call are still optimized, though
18:51:03sandalI'm pretty sure it'll be good news because the tests do pass there
18:51:25evanslava: sure, but if a no inlining into a quoation then, for instane
18:51:27headiussandal: should be at least close to MRI, modulo startup and warmup
18:51:53sandalbased on the tests, that's what I'd expect
18:52:28rueHere is a profile of a .load run http://gist.github.com/120095
18:53:01ruesandal: Those times are around what I see
18:55:01sandalheadius: takes 26s, MRI 1.8.6 13s
18:55:12sandalbut 26s was what I was getting on MRI before I optimized it
18:55:30sandalso it may be skewed do to something like pthreads or something else
18:55:55evanwow
18:56:05evanPrawn must really be leaning on String#pack
18:56:09evanand String#unpack
18:56:18sandalyeah, before toying with MRI: 33.949722 seconds
18:56:21sandalevan: very heavily
18:56:26sandalBecause of TTFunk
18:56:34evanthats why it's crazy slow
18:56:44sandalhttp://github.com/sandal/ttfunk
18:56:47evanour pack hasn't been touched, performance wise
18:56:59sandalYeah, obviously binary extraction will be faster in a non-ruby language :)
18:57:27evansandal: righto
18:57:38sandalI'll point that out in my talk.
18:59:32brixensandal: oh btw, element_referenc_spec.rb comes from ri Array#[], the docs call it Element Reference
18:59:44brixensandal: just a trivia fyi
18:59:44sandalahh, okay
19:00:08sandalCool, we do a lot of weird search stuff in my work, so I may provide aliases in both directions
19:00:42brixensandal: there's a name_map.rb in mspec that converts the names
19:00:42sandalI feel like I keep writing "Parse this no matter what the fuck you call it" again, and again, and again :)
19:00:52brixenwe could probably make it bi-dir
19:00:53sandalbrixen: Awesome! very helpful, thanks
19:01:39sandalheadius: yeah, my guess is that whatever java I'm using just isn't optimized well
19:01:42sandalheadius: http://blog.majesticseacreature.com/archives/2009.02/lies_and_statistics.html
19:02:40headiussandal: what java version?
19:02:58headiusjava 5 is slower, all java versions are slower unless you specify --server flag to jruby
19:03:08sandalwhatever is on my mac
19:03:12headiusjava 6+ with --server
19:03:15headiusmac
19:03:18headiusprobably java 5
19:03:22headiusyou could try passing --server
19:03:26headiusjruby --server -S rake examples
19:03:42headiusif you have java 6 it would be another 20-30% faster than that
19:04:08ruesandal, evan: Updated with self/s sorting
19:04:11headiussandal: http://gist.github.com/23190
19:04:22headiussource that and you'll be able to easily switch command-line "java" versions
19:04:39headiusadds a "pickjdk" command
19:05:23sandalheadius: it's java 5
19:05:42sandalI'm not going to game it by switching what I have installed here, but I'll make a note of it. I will try the --server option
19:06:00headiusfrom java 5 client to java 6 server it will be easily 2x once warmed up
19:06:01sandalI'll mention to folks that Java 6 performs better
19:07:14sandalthis kills the startup cost?
19:07:40headiusno, startup will be about the same, but "server" is the optimizing JVM JIT
19:07:56headiusmakes a very large perf difference for jruby
19:08:09rueevan: On the upside, getting the unpacking straightened would be an instant 30-40% improvement :)
19:08:48evanyep!
19:08:59evanJIT'ing blocks will help too
19:09:04evanthose use a lot of blocks.
19:10:11headiusI need to add block jitting one of these days
19:11:03rueThe kerning method taking that long is weird
19:11:27rueThough I suppose it is a lot of data?
19:12:29sandalrue: Yeah, it need to parse out kerning data for CJK fonts from a binary file
19:12:37rueSeeing if not JITting makes much difference
19:12:42rueProfile-wise
19:12:52evanrue: oh oh
19:13:05evanit's very possible profiling with the JIT on is busted
19:13:40evanI need to put the calls to start and stop profiling in
19:14:07headiussandal: you could also try passing --fast to jruby, though I'd be surprised if it fully functions
19:14:11headiusit's not quite there yet
19:15:04rueevan: Yeah, the comparison should shed some light there
19:15:51sandal? examples.each { |file| `jruby --server -Ilib #{file}` }
19:15:58sandalheadius: why wouldn't that work?
19:16:12evanrue: i'll see if i can get it wired back in today
19:16:15evanyes, we need it.
19:16:45ruesandal: It reloads the server each time
19:17:03ruesandal: For what it is worth, I am doing an -e glob and loading all the files
19:17:30headiussandal: ick, is that how you're loading them?
19:17:36sandalhehehe
19:17:40headiusthat means JVM + jruby startup every time
19:17:40sandalI know
19:17:47headiuslike an extra .5-1s every time
19:17:51sandalYeah, I should be doing better
19:17:58headiusyou could use nailgun
19:18:11sandalI really don't have time for all this infrastructure
19:18:15sandal(right now)
19:18:20headiusrun jruby --ng-server & and then use jruby --ng for your client :)
19:18:25headiusall will use one JVM then
19:18:30headiusok
19:18:37headiusyou can prod me when you want all the details
19:18:51sandalSure, and I almost certainly will because I have a real JRuby based project now
19:18:54sandalbut Prawn isn't it :)
19:19:34rueevan: Updated
19:19:36sandalI'm just going to report the stock results without any extra stuff. I'll point out that there are many ways to optimize it
19:19:38rueSignificantly different
19:19:46evanrue: with what?
19:20:02headiussandal: nice, I'd like to hear about that when you have time (on #jruby of course)
19:20:36evanrue: hm. I don't think any JITd methods will show up in here
19:20:39rueevan: Without -Xjit.enabled (but built with LLVM)
19:20:51evani'm confused.
19:21:17sandalheadius: it's just my FFI wrapper + a Sinatra web service for some windows truck routing sofwtware
19:21:22sandalThe web service is not yet built
19:21:32evanrue: what did you change?
19:21:39sandalAs I mentioned before, I think it's funny, awesome, and sad, that JRuby is the best platform on windows for that
19:22:07evanrue: just the sorting?
19:22:12rueevan: Top one is with -Xjit.enabled, middle one without
19:22:23rueLast one is % sort, with more data
19:22:50sandalYou know what, I'm not reporting times for the example runs, just order. I'm more interested in the fact that they run
19:22:56evanusing the profiler with JIT on is likely not going to give you accurate results
19:23:17rueI did see Array#index there in the bottom one...so it is only counting the ones before it is compiled?
19:23:22sandalRight now it looks like Rubinius < JRuby < MRI and I need to test REE
19:23:34sandaland MacRuby 0.4 ~= YARV
19:23:38evanrue: yes, very likely
19:23:43evanonce they are compiled
19:23:46evanthey don't show up anymore
19:23:56evanrue: what about raw time
19:23:57sandalbut i'll put a little (*) on both JRuby and Rubinius
19:24:02sandalRubinius due to pack()
19:24:03evanwith and without -Xjit.enabled
19:24:07sandalJRuby due to config
19:24:27sandalexamples and tests are what I care about
19:24:50sandalJRuby won the Prawntest because it's the only implementation to go green on the tests :)
19:25:00evansandal: not even MRI?
19:25:12sandalMRI and YARV are benchmarks
19:25:17headiussandal: ahh, yeah, there's a lot of people using simple sinatra services to wrap jruby stuff
19:25:17sandalThey're excluded
19:25:40rueevan: With JIT, about 132s...running without now
19:25:50sandalThe best implementation to run Prawn on is likely YARV for Ruby 1.9 / m17n, and JRuby for 1.8
19:26:17rueSo yeah, that Array#index in that presumably huge Array is probably a bit slow
19:26:21sandalPrawn does encoding coercion on 1.9, so the reusts are not comparable
19:26:28sandal*results
19:27:38sandalTime to check macruby again
19:28:01evanrue: interesting
19:28:08evanrue: did the no jit run finish?
19:28:23rueevan: About 162s
19:28:49sandalfire up good old MacRake
19:28:56evanrue: ok, thats good
19:28:56rueThat last_match thing, too..
19:28:57sandalwith some MacRibs
19:29:04evanwe're staying in the + column for the JIT
19:29:06evanthats good
19:30:28headiusMacRibs, mmm
19:31:38rueI wonder if it would be worth it to sort a huge array and binary search for index :)
19:32:00evanheh
19:32:09evanwell, for index
19:32:25evanhm
19:32:31evanyeah, i guess you need it to be sorted to do binary search
19:32:53sandalwhoa, this is MacFail
19:34:21sandalhttp://pastie.org/494274
19:35:55sandallooks like almost all the stuff associated with image processing failed
19:36:34evanyikes
19:36:47sandaland M17n
19:36:53sandal(aside from UTF-8)
19:37:19sandalI think open-uri segfaults
19:37:53rueNope, not a big Array...it *is* pretty slow, and getting called a lot
19:38:42headiussandal: that's 0.4 I assume
19:38:44headius?
19:38:51sandalMacRuby 0.4, yes
19:39:09sandaloh wait
19:39:11evanrue: ah!
19:39:12sandalI may be lying again
19:39:22sandalMan... I really hate this stuff
19:39:22evanrue: if you change index to use
19:39:27evan@tuple.at(@start + i)
19:39:30evanrather than at(i)
19:39:35evanthe JIT will do a better job
19:39:35sandalHow do you guys keep track of all these details?
19:39:41evanbecause it will inline Tuple#at
19:39:57rueevan: Yeah...I think the #at was a part of the API layer effort
19:40:07evani believe so
19:40:08sandalI don't consider myself very sloppy, but when it comes to doing anything with sys-admin, I fail epic
19:40:43evanrue: we can teach the JIT about Array#at too
19:40:47evani think we use a prim for it
19:41:00evananything thats a prim is pretty easy to teach the JIT about
19:41:15rueThe default is the primitive, yes
19:41:41evanwe should definitely teach the JIT about Array#at then
19:41:46evanbecause it's used a lot.
19:41:46sandaloh waitwait, maybe false alarm
19:41:52sandalI think these are the results for macruby 0.4
19:41:53evanit's the workhorse of the Array code
19:43:27sandal$ which macruby
19:43:28sandal/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/bin//macruby
19:43:36sandaldoes that look like it should be 0.4?
19:43:44sandalthat is what which macruby returns now
19:44:01rue?
19:44:07rue`macruby -v` ?
19:44:24sandalyeah, gives 0.4
19:44:25sandalbut I wasn't sure if 0.5 version# was updated yet
19:44:33sandalokay, generating the same giant stream of WTF
19:44:44sandalso I need to retract my statement about MacRuby
19:44:56rue0.5 does not run much yet
19:45:57sandalI know that much
19:46:11sandalBut I previously reported that 0.4 ran all the examples
19:46:13rueevan: "Inlining" the #at call makes pretty much no difference...figured I would try it
19:46:24sandalit's actualy only running some successfully
19:46:33evanrue: ie, doing @tuple.at(@start + i)
19:46:40evanmmmzers
19:46:41evanok
19:46:51rueRight
19:47:26rueLooks like the biggest Array is <300 elements...so it is still kind of odd
19:48:46evanhm.
19:48:47evanyeah
19:49:37sandalOkay, so Prawn is not really usable on MacRuby yet
19:49:51sandalBecause it only renders the basic stuff
19:50:00sandalbuilt-in fonts and line drawings and stuff
19:50:46sandalBasically, sounds like they've got a messed up pack/unpack, or weird m17n issues that are warping my binaries
19:51:18sandalaha!
19:51:20sandalirb(main):001:0> File.binread
19:51:20sandalNoMethodError: undefined method `binread' for File:Class
19:51:46sandalbecause of this, Prawn will provide a binread method that just does, File.open("foo", "rb") { |f| f.read }
19:52:01sandalso my guess is that the majority of these errors come from treating binary files like they're UTF-8
19:56:26rueThe b really should not matter on non-Winders
20:11:15sandalrue: this is not true for 1.9
20:11:16sandalat all
20:11:37sandalThe b sets external encoding to BINARY
20:11:42sandalThat's in my talk :)
20:11:54sandalyou can of course do this explicitly
20:12:01sandalbut "b" implicitly does
20:12:10sandalbut if MacRuby doesn't do that, it's not 1.9.1 compatible
20:12:35rueHm, weird.
20:12:43sandalyou'll have all sorts of fun playing with binary files on Ruby 1.9.1 if you forget to set this, since Ruby will just check your locale for settings
20:13:01sandalMine is UTF-8, so... it'd think a binary was made out of UTF-8
20:13:08sandaland access it accordingly
20:13:25sandalbut yours may be different
20:13:26rueReally wish they had made a library out of it
20:13:33sandalthat's why portable code must be explicit
20:13:37sandalthe m17n stuff?
20:13:41rueYes
20:13:43sandalIt'd be way too hard
20:13:49sandalit's a very complicated system
20:14:22sandalThough it'd be interesting to see what 1.9 (YARV based) would look like with all that stripped out
20:24:54rueWell, I am not sure about the entire M17N thing to begin with, but perhaps it is too intractable
20:37:32ruebrixen: OK to change the precision for the ms figures? Or is that beyond accuracy anyway?
20:42:43evanrue: likely beyond accuracy
20:46:23rueWtf...my spec runtime log is gone :/
20:48:18rueWell, it purports to have data...dunno how accurate
20:48:42rueEnumerable#inject => 0.003ms/call
20:50:29evanrue: well, is data that tiny useful though?
20:52:15rueWell, 's kind of better than half the stuff having 0.00 there
20:52:23rueBut I will leave it up to brixen to change
20:52:33evanyeah
20:52:41evanwe talked about not even showing ones with 0.00
20:53:05rueThe number of calls is significant, though
20:53:19evanmaybe thats why he left it in
20:53:49rueString#[] is 0.00 but it is called 3,4m times so its total time is almost 14s
20:54:13evanah ah
20:54:15evani see what ya mean
20:54:18evanright
20:55:31rueSo it is something like 0.004ms/call
20:56:08evanit's nice to have the .'s lined up
20:56:16evanbut isn't strictly necessary
20:56:26evanfor the ones that are like 20154.32
20:56:31evanthe .32 is insignificant
20:57:10evanso maybe if it's over 100, leave off the decimal places
20:57:32evanand if it's under 0.1, add an extra
20:57:40evanso 20134.32 becomes 20134
20:57:44evanand 0.00 becomes 0.003
20:58:18evananyway, i need a lunch!
20:58:26rueYep yep
20:58:49sandalhttp://pastie.org/494392
20:58:52sandalResults of Prawn test
20:59:01sandalTotally ridiculous
20:59:37rueAww, no tests?
20:59:51sandalBecause of the Module#name issue
21:00:05sandalIf I got a patch to test-spec working in time it could be different
21:00:19evansandal: we'll fix than in rubinius today
21:00:25evanlikely right after lunch
21:00:28evanso you can run them
21:00:33sandalevan: Okay, well I'll give it a try
21:00:50sandalEven if it fails some, you can at least pick up half a point :)
21:01:26rueevan: @__name__ ?
21:01:30sandalBasically, I'm excited about all this stuff, the stories behind the scores are more interesting
21:01:41sandaland the prawntest itself is mostly a joke
21:01:46evanno no
21:01:49sandalthough I'm glad that something productive has come out of it
21:01:50evan@module_name
21:02:10evanok, lunch time.
21:02:12rueThen someone will just use that as their accessor name :/
21:02:19sandalevan: I'll check it late tonight
21:02:21evanwe'll deal with that then.
21:02:23sandalso if you fix it, I'll re-run
21:02:40evanok really lunch
21:02:44rueUnderscores would follow the __send__ etc. policy
21:03:01headiusnew tagline: JRuby is XXX according to sandal
21:03:14rueheadius: And no mention of Java ;)
21:04:28headiusJRuby: Ruby EXXXTREME
21:04:55rueAlright now, let us not get carried away
21:24:09rueFrom #ruby-lang, someone noticed that Class.new calls inherited after executing the body
21:57:43dgtizedevan: out of curiousity why is it we are storing the module name in an instance variable, and not simply installing a name method that returns the constant value?
21:59:32evanbecause it seems silly to generate all those methods
22:00:46rueIf the method gets overridden, there is no recourse
22:00:46dgtizedhmm -- I guess I'm not quite following why it's silly in this case
22:01:30evanwhy generate 1000 methods that return a symbol because there are 1000 modules
22:01:39dgtizedrue: but in mri you can override name
22:02:11dgtizedmodule Foo; def self.name; return "blah"; end; end
22:02:54evandgtized: whats your point?
22:03:01evani don't get where you're going
22:03:40dgtizedmy point with the example was simply I didn't follow why an override bothered rue
22:04:32headiushave to store the name somewhere
22:04:41headiusunless you generate a new name method that returns a literal for every class
22:04:48dgtizedheadius: that's what I was suggesting
22:04:59evanthats just super wasteful
22:05:01headiusok :) and I think evan doesn't like that
22:05:14headiusI tend to agree, since there's thousands of classes in rails
22:05:14evanand if thats the only place the name lives
22:05:24evanand someone changes .name
22:05:31evanyou've lost the ability to find out the real name of thing
22:05:34evanwhich is needed.
22:05:35headiusplus that wouldn't be semantically right
22:05:47headiusit would have name methods defined on every class, which changes the overriding behavior
22:05:56evanyep
22:06:00headiusrather than a single name defined on Module
22:06:13evanso, in name's case
22:06:15evanit's actually a slot
22:06:33evanthe VM lowers the @name syntax to access the proper slot
22:06:43evani could, instead, have it use __slotname__
22:06:49evani think we discussed that at one point
22:07:18evanso it would still be Module::name_ in the VM, but would be accessed as @__name__ in ruby code
22:08:32evanthats a little strange, but not the end of the world
22:09:08dgtizedI guess partially perhaps I don't quite follow the conditions that are actually setting @name in the kernel code since we have this set_name_if_necessary method
22:09:39evanignore that method
22:09:50evanit has no relation to this discussion
22:09:55dgtizedok
22:10:06dgtizedit's only in VM code that we really care about this then?
22:10:15evanexactly the opposite
22:10:25evanit's in ruby code
22:10:37evandgtized: did you follow the discussion from the last few days about this?
22:11:03dgtizedI follow that in ruby code that's where we can override and it messes things up, but I'm not following where in the Kernel code we depend heavily on the value of Module.name
22:11:25evanthats not the issue
22:11:34evanyou've got the reasoning for this problem wrong
22:12:06evan1) Rubinius stores the name of a Module in @name
22:12:17evan2) Module#name is an accessor for that ivar
22:12:48evan3) test/spec used attr_accessor :name and then tried to do Blah.name = "fun times"
22:13:00evan4) This caused a TypeError because the VM needs @name to be a Symbol
22:13:10evanTHATS the problem.
22:13:21evanso we've been discussing solutions to this
22:13:26evanone being, change @name in Module
22:13:45evanso that test/spec can happily do attr_accessor :name
22:14:04evananyway, this discuss is largely over
22:14:11evani'm going to just change it to be @module_name for now.
22:14:26evandiscussion
22:15:18headiusevan: I have an idea for a library that monkey-patches attr_accessor :module_name into Module, what do you think?
22:15:38headiushey, macruby experimental status update
22:15:39headiusnifty
22:16:12evanheadius: yes, i know it's a kludge.
22:16:20evansue me.
22:16:46headiusadd a compiler plugin that turns @int_name into some impossible-to-access name
22:17:01headiuslike __name__ without the @, internal variables like MRI
22:17:34headiusor an opcode for accessing internal variables
22:17:45evani've got the opcode
22:17:45headiusintvar_get, intvar_set
22:18:11evanit's always been a question of how it's accessed in ruby
22:18:12headiuskludge is fine for now, of course :)
22:18:29headiuswith your compiler transforms that should be easy now though
22:18:41headiusrecognize fcalls to intvar_get and intvar_set as the opcode
22:18:54evanwhats intvar
22:19:22dgtizedinternal variable
22:19:28evanso what
22:19:32evanintvar_get :name
22:19:35evanew.
22:19:49evanno thankyou.
22:20:33dgtizedI guess the problem is that there are places where we have nice cleanly delimited turtles, and we have other places where the turtles are mutant half turtle, half vm
22:20:43evannot really
22:20:59evanthe whole point is that the code, no matter where the data is stored, is accessible like normal ruby data
22:21:06evanwhich, as we see, has it's ups and downs.
22:22:08headiusand you know I don't hold that as sacred, so feel free to ignore me :)
22:22:24headiusno pure-ruby solution is going to be unbreakable
22:22:50evani'm fine with it not being unbreakable
22:23:11evanthe code in the kernel would be so fucking gross if we have to use some ugly indirection to access the common data
22:23:18evanit's in every method
22:23:35evanyes yes, put it behind accessors, i've heard that before.
22:23:45evanthen there are a zillion crap methods.
22:24:39headiusno, just two: intvar_get and intvar_set :)
22:24:49headiusfor most of these cases you could just use internal vars and be done with it
22:25:06headiusyou could even do the transformation against the full name
22:25:10dgtizedwhich disappear in a flash of JIT inlining? -- anyway, I mostly agree, I'm just trying to think about likely issues in places like Array.tuple
22:25:26headiusintvar_get_name => opcode intvar_get "name"
22:25:42evanwould you do that to your java code?
22:26:35headiusour java code isn't breakable by ruby dweebs
22:26:40evanif it was
22:26:46headiusyes ;)
22:26:46evani'm saying
22:26:58headiusbecause there's very few internal variables that would need it
22:27:03evani'm not, at this point, willing to deal with it being so ugly.
22:27:12headiusso do a prettier version :)
22:27:13evanheadius: thats not true
22:27:22evanyou don't use ivars for any internal data on any class
22:27:39evanso every data member on every class had to be accessed via some side entrace
22:28:18evandgtized: as for inlining, since i'm the only one working on that, i'm not going to hang my hat on inlining to do future work
22:28:27evanby cluttering it up even more now.
22:28:34evanwith extremely limited payoff
22:29:21evanwe all have to draw lines somewhere
22:29:27evanand i'm drawing a line here.
22:30:59evanI should note
22:31:14evanthat this problem exists for all class we implement in pure ruby
22:31:19evanMethod, for instance
22:31:30evanand no manner of internal variable hacks will save us there
22:31:34evanbecause there are no internal variables
22:35:22dgtizedyuck, what's with this @subclasses on Class for ObjectSpace
22:36:19evanso that ObjectSpace.each_object(Class) works
22:36:49boyscoutMove Module::name_ to Module::module_name_ to decrease conflicts - f2f4fa8 - Evan Phoenix
22:37:11evanproblem solved, for now.
22:37:12dgtizedevan: we don't keep around a list of all classes in one of the TypeRoot's?
22:37:37evanno
22:38:10evanwell i guess
22:38:13evanbut why
22:38:22evanwhy is that better than @subclasses
22:40:44dgtizedArray.instance_variables
22:40:55dgtizedI dunno it just surprised me mostly
22:41:48evanso you're arguement is it's not hidden?
22:42:31dgtizedwhen do you garbage collect module definitions?
22:42:44dgtizedif they are referenced in __subclasses__ they can't can they?
22:42:59evana very good point
22:43:03evanwe need fix that
22:43:04headiusevan: did we ever make @subclasses weak?
22:43:07evansubclasses should be weakrefs
22:43:13headiusit's weak in JRuby but I think you had me punt on it when I implemented that
22:43:27evanyep
22:43:35evansomeone added it at one point in rubinius
22:43:43headiusI did
22:43:51headiusmaybe someone re-added it, but I did the original impl
22:44:04evanI need to write WeakArray
22:44:19headiusyeah, on jruby it's a WeakHashSet
22:44:42evanyeah, or WeakHash
22:45:21dgtizedquestion, is it actually that you need to keep track of all subclasses, or is that we need to keep track of all Classes, because at the very least if it's the second we could just have an ivar on ObjectSpace to deal with that
22:45:37dgtizedand then iterate that array checking if it's a subclass of X that you are searching for
22:46:33evanthats just 2 ways of storing the same data
22:46:39evanhaving @subclasses is faster.
22:47:23dgtizedbut then we need an extra ivar on every Class def
22:47:49evanso
22:47:53evanwhy is that bad
22:48:36dgtizedmy metaclass understanding is weak, but doesn't that increase the cost of metaclasses?
22:48:57dgtizedor rather singleton I mean, or eigenclass or whatever the standard nomenclature is
22:49:12evanthere is no increased cost
22:49:20evanthey perhaps use an extra 4 bytes
22:50:21dgtizedalright, I guess it just seemed like better seperation of concerns to have it on objectspace or objectspace walk the actual class definition graph
22:50:31dgtizedbut maybe I am just splitting hairs
22:51:03dgtizedanyway, do you want me to file an issue on the GC problem for @subclasses?
22:51:12dgtizedso we don't forget?
22:52:59evanyes please
22:56:29dgtizedalso, so I gather now we only use the github issue tracker and ignore lighthouse?
22:59:10evani'm pushing people to the github issue tracker
22:59:15evanit's a bit easier to manage with the code
22:59:45headius@subclasses will be useful for other things
23:00:19dgtizedheadius: so you just think it should be included in general?
23:13:57headiusdgtized: I don't see that it hurts anything
23:15:14evanat this point, probably 90% of each_object usage is to find subclasses
23:15:18evanthe other 10% is memory debugging
23:23:02rueI still think it would be simplest to just say that users always fuck with Core classes at their own risk, make it a library issue. Or, alternatively, decree that said rule applies for all methods and variables with double underscores
23:24:11rueForcing some internal scheme is just ugly
23:55:15ruetermtter gets an upvote from me
23:57:00rueHrm. #10 is a bit iffy
23:58:07evaneh?
23:58:23ruehttp://github.com/evanphx/rubinius/issues/#issue/10
23:59:02evanah
23:59:04evanyes, thats wrong
23:59:12evanI need to use the proper 64bit version
23:59:37rueevan: Which GCC are you running?
23:59:51evan4.0.1