<eregon>
etehtsea_: re tags per platform: it's manual currently but rather easy, see spec/jruby.2.3.mspec and look for windows and ci_xtags
<chrisseaton>
The first one you showed will be better in optimising implementations of Ruby
<chrisseaton>
The second one is writing to global memory with those temporary values
<chrisseaton>
If you used local variables instead of instance variables they'd be equivalent
<chrisseaton>
In most languages, but not Ruby due to Proc#binding
<yopp>
Yeah
<yopp>
That's kinda tricky to use lvars here
<chrisseaton>
How come?
<yopp>
This is method body, and *_w* values can change over time
<chrisseaton>
But why store temporary values like a, b, c, d in instance variables?
<yopp>
ah, here you are right, they can be lvars
<chrisseaton>
In Ruby local variables are a bit like instance variables anyway as you can get the binding as an object. I think only Truffle is able to put local variables in a block actually onto the stack
<yopp>
I see only one benefit of having intermediate values here: parallelization.
<chrisseaton>
You mean you think the processor could calculate a, b, c, d in parallel?
<yopp>
Nope, I think I can do some kind of queue for independent equations
<yopp>
a & b; c & d; e.
<chrisseaton>
The processor will already run as much as this in parallel as it can, whether you use local variables or not
<yopp>
hum
<chrisseaton>
And this is too little code to manually parallelise
<yopp>
this is just very simple example
<yopp>
this is very naive and simple model of neural network with hidden layer
<chrisseaton>
If you are really writing code that looks like this you should look at Truffle as it will do very well with it
<yopp>
I've just started, I'm researching idea of using codegeneration, instead of matrix math
<chrisseaton>
Here's a top tip for Ruby code generation - don't use SSA, because due to bindings Ruby implementations can't reuse local variables and you'll end up with massive frames
<yopp>
SSA?
pawnbox has quit [Remote host closed the connection]
<chrisseaton>
If you generate code with temporary local variables, don't give each one a unique name - reuse the same names
<chrisseaton>
don't use local1, local2, ..., local10000 - reuse the same small set of local variables
<chrisseaton>
Because eliminating lots of local variables is very hard - not even Truffle does it at the moment
<yopp>
Uh, that's hard task as well. Because in this case I should somehow check that previous variables are not used in later code
<chrisseaton>
It's basically register allocation
pawnbox has joined #jruby
<yopp>
I'd like to get to the point where I can make simple network that is capable of at least learning basic boolean math and then I'll take it from there. And then do rest of optimizations.
<yopp>
I'm not sure how good evaled code jited this days
<yopp>
if jited at all
<chrisseaton>
I can't see why it be eval'd would make a difference to whether a JIT would run
<chrisseaton>
These days JRuby and JRuby+Truffle are the only JITs for Ruby, and they don't mind
tcrawley-away is now known as tcrawley
<yopp>
cool
pawnbox has quit [Ping timeout: 256 seconds]
AckZ has quit []
vtunka has quit [Ping timeout: 265 seconds]
pitr-ch has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pitr-ch has joined #jruby
shellac has quit [Quit: Computer has gone to sleep.]
pawnbox has joined #jruby
shellac has joined #jruby
pawnbox has quit [Ping timeout: 252 seconds]
pawnbox has joined #jruby
lance|afk is now known as lanceball
drbobbeaty has quit [Ping timeout: 264 seconds]
drbobbeaty has joined #jruby
<GitHub109>
[jruby] chrisseaton created lambdas (+2 new commits): https://git.io/vPCT0
<GitHub109>
jruby/lambdas 21069b6 Chris Seaton: [Truffle] Global replace anonymous classes with lambdas.
<GitHub109>
jruby/lambdas f8d14d0 Chris Seaton: [Truffle] Organise imports.
<GitHub43>
[jruby] chrisseaton fast-forwarded truffle-head from d7ca7b7 to f8d14d0: https://git.io/vPCTE
<GitHub1>
[jruby] chrisseaton opened pull request #4208: [Truffle] Global replace anonymous classes with lambdas. (truffle-head...lambdas) https://git.io/vPCTa
beawesomeinstead has quit [Read error: Connection reset by peer]
<GitHub170>
jruby/master 3eb15d4 Charles Oliver Nutter: Add tags for Truffle.
<enebo>
tenderlove: but we want to make sure by next major release we can figure what we need so we can not duplicate any of it
<tenderlove>
matthewd: JRuby folks want to reuse our existing AR code, but since we have stuff at the top of the adapter like "gem 'sqlite3'" it's a showstopper for them
<headius>
enebo: we could read in the source, remove that line, and eval it :-)
<enebo>
hahaha
<tenderlove>
I suggested we extract that to a method or something that they could override
<enebo>
tenderlove: what I don’t know is whether that is really even required at that point for the adapters to load
<tenderlove>
I don't think so
<tenderlove>
pretty sure all the native bits are only used at run time
<headius>
I was also thinking about moving code in the adapters that doesn't call the ext directly to a separate module we can both include
<matthewd>
We do it there so we can report a missing dependency gem as being equivalent to the adapter itself not being available
<tenderlove>
we can have the thing that loads the adapter turn around and call a method on the adapter it just loaded
<enebo>
tenderlove: yeah I saw nothing which seemed to indicate it is needed
<matthewd>
So yeah, moving to a method we call just after loading it seems fine
pawnbox has joined #jruby
<headius>
matthewd: makes sense
<enebo>
so perhaps we can remove that gem locallty and continue with our expeiment to see whatother problems pop up if any
<enebo>
the first problem of us having the same require as the real adapter is also really gross
<tenderlove>
enebo: that sounds like your problem ;)
<enebo>
but I think we can make an ugly magical method to require real AR version in our fake one
<enebo>
tenderlove: yeah it is just an issue with our adapters pretending to be your adapters
<tenderlove>
you want people to be able to do "adapter: sqlite3" in their config.yml
<enebo>
so we could make a jruby_sqlite3 and have rails add that magic but it is special code
<matthewd>
Maybe we could switch to an adapter name registry, instead of just using a blind require
<tenderlove>
ya
<tenderlove>
I was wondering if there was a way we could let JRuby change the logic for how we figure out which file to require
<matthewd>
It's all in one terrible method atm, I believe
<enebo>
I hacked it by deleting the load path dir where our require came from then calling require again then restoring the load path
pawnbox has quit [Ping timeout: 256 seconds]
<enebo>
which is pretty gross :)
<enebo>
matthewd: tenderlove: thanks for talking this over with us. we really need to reuse ar code more so we can minimize this maintenance. I think we hit a saturation point on how much we can support :)
<tenderlove>
can you guys figure out what you would like there?
<tenderlove>
We're open to changing that part; it's not great
<tenderlove>
I'm just not sure how you'd go about injecting yourself in there so you can do your own thing
<enebo>
tenderlove: yeah I think registering the adapter would be a good way since then we could change the name and just do a simple require of the code we want to share
<matthewd>
Oh hey, there's already a mechanism for an adapter name registry... just define Resolver#require :)
<tenderlove>
loooooool
<tenderlove>
you could do that
<tenderlove>
it would work
<enebo>
fwiw I have no idea how any of this is really bootstrapped by rails to begin with
<tenderlove>
enebo: even with the registry thing though, I'm not sure how you hook in soon enough to make changes like that
<enebo>
yeah I guess something has to do the registering
<tenderlove>
when people use Rails with JRuby, they'll have to include a JDBC gem, right?
<tenderlove>
maybe you can include a railtie in there that does the freedom patching or adapter registration
<matthewd>
Gems get required by bundler before we think about DB config, so yeah, that'd be the hook point
<tenderlove>
ya
<headius>
tenderlove: activerecord-jdbcsqlite3-adapter has jdbc-sqlite3 as a dep
<headius>
so they (or rails app gen) just uses the right ar-jdbc for the db
<headius>
we publish separate gems for each supported db
<enebo>
and Rails seems to put proper stuff in Gemfile
<enebo>
gem 'activerecord-jdbcsqlite3-adapter'
<enebo>
well only that but as headius says anything else is transitive dep from that
<headius>
yeah we worked with rails folks to make it generate right requires for JRuby
<headius>
and Gemfile etc
<enebo>
My only wish is that bundler would allow multiple lock files per impl
<enebo>
or one per impl so I can run jruby and mri on same app at same time without having to copy it to two places or regenerate
<headius>
yeah, I think that is rotting in a PR somewhere
<enebo>
but I am just babbling on irc
<headius>
or it has only been done as one-off monkey patches
* enebo
tries to maintain focus
<headius>
FOCUS DUDE
<enebo>
headius: I know someone maintains a patch for this (maybe logstash people?)
<headius>
atambo I think
<headius>
maybe logstash though
nicksieg_ has joined #jruby
nicksieger has quit [Read error: Connection reset by peer]
nicksieg_ has quit [Read error: Connection reset by peer]
nicksieger has joined #jruby
pawnbox has joined #jruby
nicksieger has quit [Read error: Connection reset by peer]
<GitHub1>
jruby/master 56eeca0 Charles Oliver Nutter: Update to latest Psych.
donValentin has quit [Quit: donValentin]
pitr-ch has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<chrisarcand>
headius: enebo: chrisseaton: I'm a little sad they put both the JRuby/Truffle talks [that I know of] in the same timeslot. http://rubyconf.org/schedule#friday
pitr-ch has joined #jruby
<headius>
chrisarcand: ugh why would they do that?
<headius>
we need to fix that
<chrisarcand>
Maybe contact sarah and see if one of you guy can switch with one of the non-track ones in the morning hours that day