These are chat archives for opal/opal

8th
Jul 2015
Forrest Chang
@fkchang
Jul 08 2015 00:04
@meh so what's an example where you want to the extend the native class prototype?
meh.
@meh
Jul 08 2015 00:05
it's when you do not want to that matters
for example in IE6..8 extending the DOM would cause an exception
Forrest Chang
@fkchang
Jul 08 2015 00:08
@meh then it would seem that there's no advantage to toll free bridging. include Native seems to be across the board safer, unless you are wanting to call opal methods off of native js objects. Is there any performance benefits?
meh.
@meh
Jul 08 2015 00:09
from my tests there's no meaningful overhead between wrapping and extending
Forrest Chang
@fkchang
Jul 08 2015 00:11
@meh any history to the name "toll free" bridging? It would seem to imply that include Native is "toll required" bridging, to which I ask, "what is the toll?"
though I think toll free bridging is done on numbers, strings, etc. for performance reasons
rather than wrapping those
meh.
@meh
Jul 08 2015 00:13
those are not for performance reasons
but for usability reasons
you'd have to call #to_n on all of them otherwise
which would make it a pain in the ass even within the corelib
to stay on the safe side you should still call #to_n on those tho
because they call valueOf() on self or other things
Forrest Chang
@fkchang
Jul 08 2015 00:14
@meh so then, there is some sort of benefit to toll free bridging, but what would it be?
meh.
@meh
Jul 08 2015 00:15
for things that aren't in the corelib? none
Forrest Chang
@fkchang
Jul 08 2015 00:16
that's a start. I'll note that opal-jquery does toll free bridging on element. @elia said he took advantage of the js object being extended, I'd be curious as to what circumstances
@meh does opal-browser do any toll free bridging?
meh.
@meh
Jul 08 2015 00:16
nope
Forrest Chang
@fkchang
Jul 08 2015 00:17
so then general advice would be to favor include Native then
meh.
@meh
Jul 08 2015 00:17
yep
Forrest Chang
@fkchang
Jul 08 2015 00:18
thx
@meh btw, working on anything cool lately?
meh.
@meh
Jul 08 2015 00:18
working on a game in Rust
Forrest Chang
@fkchang
Jul 08 2015 00:18
ironically, my 13 yr old son just wrote a tic tac toe game in Rust
meh.
@meh
Jul 08 2015 00:18
noice
send him towards glium and 3d stuff :^)
Forrest Chang
@fkchang
Jul 08 2015 00:20
yeah, he impresses me, taught himself java to write an adventure game, then ruby for another text based game, started SICP, but when stalled redirected to Rust. I explained to him virtualbox and he's been running different distro's to do his develpoment on
Torsten RĂ¼ger
@rubydesign
Jul 08 2015 01:33
@meh i was trying to follow the native discussion and looked at browser source. A lot of include Native there, but not much alias_native. I wonder is it even possible to use alias_naive when wrapping a larger api (for me pixi). I seems that "ruby" objects would make it back into the js framework and boom
Maybe just for simple attribute readers ?
Jikku Jose
@JikkuJose
Jul 08 2015 02:04
@jgaskins Thanks! I will look into it! Infact I prefer Haml better, I didn't expect to see it.