meh` changed the topic of #opal to: http://opalrb.org - Ruby runtime and library on top of Javascript | 1.0.0 is near | This channel is logged at https://botbot.me/freenode/opal/
Noldorin has quit [Read error: Connection reset by peer]
Noldorin has joined #opal
e_dub has joined #opal
ryanstout has quit [Quit: ryanstout]
chesterbr has joined #opal
RoxasShadowRS has quit [Read error: Connection reset by peer]
<chesterbr> hello, anyone there?
ryanstout has joined #opal
mneorr has quit [Remote host closed the connection]
<ryanstout> chesterbr: I'm around, anything I can help with?
mneorr has joined #opal
<chesterbr> ah, nothing, just wanted to share that I finally could run enough of my Atari 2600 emulator written in Ruby using Opal inside a browser: https://dl.dropboxusercontent.com/u/1545151/Screen%20Shot%202014-02-11%20at%209.39.41%20PM.png
<ryanstout> cool
<ryanstout> was it a lot of work to get it running in opal?
<chesterbr> it is about 1/15 of the MRI speed, but this is the first attempt at coding, there are several optimizations to do
<chesterbr> well, I had to do a couple of pull requests on Opal (dark corners like bit manipulation)
<ryanstout> yea
<ryanstout> hopefully there's some performance optimizations opal can do also
<chesterbr> but the only *real* change in emulator code was to surround divisions with to_i (since Numeric->JavaScript doesn't have the concept of "integer division")
<ryanstout> running a VM is probably not a common JS use case either
<ryanstout> ah, yea
<chesterbr> other than that, I have all but a few specs running (mostly because of RSpec dark magic that I have to fix)
mneorr has quit [Ping timeout: 245 seconds]
<chesterbr> but I need to properly set up a loop that doesn't lock the browser main thread
<chesterbr> I have to keep the console open to avoid it to freak, which is likely slowing things down
<ryanstout> yea, I think when console is open in chrome a bunch of things get added which slow things down
<chesterbr> anyway, my main goal was running on a browser (MRI is a bit odd to set up with graphic libs)
<chesterbr> for sure
<ryanstout> yea, I usually end up using jruby and some java stuff when I do graphics stuff (which also isn't ideal)
<chesterbr> JRuby got me 2x the MRI performance, which was nice (it is still unplayable due to speed regardless of which Ruby)
<ryanstout> did you have invoke dynamic and ire 7?
<chesterbr> I believe so (last time I tried I was using JRE 7 and a quite recent JRuby, so I'd guess it would use that)
<chesterbr> anyway, I've been uploading the opal version here: https://github.com/chesterbr/ruby2600/tree/opal_rspec3 (needs https://github.com/opal/opal/pull/507 to properly run, but I hope meh can merge that soon)
<ryanstout> actually, for various reasons jruby doesn't use invoke-dynamic by default in Java 7
<ryanstout> its a big performance improvement most of the time (over normal jruby)
<ryanstout> you have to set a flag to enable it
<chesterbr> ah, didn't know that!
<ryanstout> yea, try it with: -Xcompile.invokedynamic=true
<chesterbr> definitely worth trying - this is the kind of code that would surely benefit from less indirections
<ryanstout> yea, I think jruby is getting really good at inlining more stuff
<chesterbr> thanks for the tip, will test and let you know!
<ryanstout> no prob
<ryanstout> how long have you been working on ruby2600?
<chesterbr> not long, I started toying with the idea around June last year (to present it at RubyConf BR in August). Since then it's been on-and-off (whenever I have time + some crazy idea like cross compiling to JS)
<chesterbr> never had written an emulator before, so it was a *huge* learning experience
<ryanstout> how many instructions are there?
<chesterbr> if I recall correctly, the 6502 lists a bit less than 60, but variated opcodes grow the number to around 150
<ryanstout> are they all used?
<chesterbr> (actually a 6507, but software-wise it's the same thing, and people know the 6502 better because of C64/Apple II)
<chesterbr> yep. games did *a lot* of trickery to squeeze performance
<chesterbr> actually, the CPU was less of a problem
<chesterbr> it is hugely well documented and has loads of sane test code
<chesterbr> the biggest issue was the video chip (TIA)
<ryanstout> interesting
<chesterbr> which was custom-built for the 2600, and has no frame buffer
<chesterbr> the game code pretty much controls the CRT beam colours as it gets drawn on the screen
<ryanstout> humm
<ryanstout> so is it fast enough with opal to play at a decent frame-rate?
<chesterbr> so timing is a fundamental thing, and I can't do classic emulator tricks like skipping/caching frames
<chesterbr> nope, even with JRuby it goes at around 2-3FPS (where I'd need 60)
<ryanstout> bummer
<ryanstout> just wait another 10 years :-)
<ryanstout> jk
<chesterbr> MRI gets 1-2. Opal is hard to say (I've *just* been able to render a frame that took 15s, but I'm sure it can be enhanced)
<chesterbr> heh, actually this is one of the "strategies" I've discussed on the presentation :-D
<chesterbr> a Moore's Law chart :-)
<ryanstout> yea
<chesterbr> there are some algorithmic enhancements I still have to try, but right now my focus is to see if I can get Opal close to the other rubies
<chesterbr> thanks for the chat (and the JRuby option tip, will try that soon!), gotta go. Bye!
chesterbr has quit [Quit: chesterbr]
Noldorin has quit [Ping timeout: 248 seconds]
Noldorin has joined #opal
meh` has quit [Ping timeout: 250 seconds]
Noldorin has quit []
ryanstout has quit [Quit: ryanstout]
dimaursu16 has joined #opal
elia has joined #opal
mneorr has joined #opal
mneorr has quit [Ping timeout: 272 seconds]
<elia> adambeynon, I think vienna could be generating bad html… not sure tho https://gist.github.com/elia/3b33b0106e2028998df5
<elia> this is from a dump of body in the midst of a todomvc failing test
kludge` has quit [Ping timeout: 272 seconds]
mneorr has joined #opal
kludge` has joined #opal
mneorr has quit [Read error: Operation timed out]
elia has quit [Ping timeout: 260 seconds]
RoxasShadowRS has joined #opal
e_dub has quit [Quit: It's a hard knock life]
DouweM has joined #opal
elia has joined #opal
meh` has joined #opal
elia has quit [Read error: Connection reset by peer]
elia has joined #opal
<meh`> elia, no love for lissio? :<
<elia> meh`, lol
<elia> meh`, the screencast is a killing feat
<elia> reading stuff (a readme or sourcode) is hard
<elia> meh`, we should buy fkchang into producing one…
<meh`> and have your designer guys make a logo
<elia> lol I have no designer guys!
<elia> I did the opal logo by myself (and almost by accident)
<elia> (or luck if you want)
<meh`> nice
<meh`> lol
<elia> meh`, also spamming todomvc could be a good strategy
e_dub has joined #opal
<adambeynon> hi elia
<elia> hey there
<adambeynon> the divs inside the <li> tags?
<elia> yep, I saw spurious closing </li>
<elia> but didn't have time to dig deeper
<adambeynon> i'll take a look now
<adambeynon> are you working on opal/todomvc ?
<elia> yes, see the link for instructions
<elia> the setup experience should be quite smooth now
<elia> mocha commands should be ran from /browser-tests
<meh`> adambeynon, any clue about the RubySpec issue on gh507?
<[o__o]> Making shifts with negative counts reverse the shift direction: https://github.com/opal/opal/pull/507
<adambeynon> meh`: so, those two method definitions are missing?
<adambeynon> seems to be defined there
<adambeynon> seems to be a special case for each impl
mneorr has joined #opal
mneorr has quit [Ping timeout: 250 seconds]
Noldorin has joined #opal
ryanstout has joined #opal
mneorr has joined #opal
mneorr has quit [Ping timeout: 245 seconds]
<adambeynon> hi ryanstout. I forget, why do all the values use underscores in volt?
elia has quit [Ping timeout: 250 seconds]
<ryanstout> adambeynon: its to distinguish "properties" from methods, so when you call ._something, it returns nil, .something raises an exception
<ryanstout> does that make since?
<ryanstout> I may get rid of the _ stuff, but I think it saves a bunch of errors
<ryanstout> because otherwise if you have a typo for a method name, it doesn't raise an exception
<ryanstout> the models are going to have it where you can define your own classes for them
<adambeynon> ahh, right. makes sense
<ryanstout> I'm trying to think if there a better way. Probably the better way is to just have models use the hash accessor syntax. But there's a few things I don't like about that way.
e_dub has quit [Quit: It's a hard knock life]
DrShoggoth has joined #opal
Noldorin has quit []
mneorr_ has joined #opal
mneorr_ has quit [Remote host closed the connection]
mneorr has joined #opal
mneorr has quit [Ping timeout: 250 seconds]
mneorr has joined #opal
mneorr has quit [Remote host closed the connection]
mneorr has joined #opal
e_dub has joined #opal
DrShoggoth has quit [Ping timeout: 272 seconds]
Noldorin has joined #opal
DrShoggoth has joined #opal
<ryanstout> adambeynon: just curious if you have had a chance to look at: https://github.com/opal/opal/issues/500 Its causing me a bunch of issues. Thanks
<adambeynon> ryanstout: is it just happening if you use a splat?
<ryanstout> yea
<ryanstout> I think
mneorr has quit [Remote host closed the connection]
mneorr has joined #opal
mneorr has quit [Ping timeout: 260 seconds]
<adambeynon> hmm, cant work out why its happening
<adambeynon> need to dig a bit deeper on this one
<ryanstout> adambeynon: thanks. Let me know if I can help.
e_dub has quit [Quit: It's a hard knock life]
e_dub has joined #opal
mneorr has joined #opal
DrShoggoth has quit [Read error: Connection reset by peer]
DrShoggoth has joined #opal
DrShoggoth has quit [Read error: Connection reset by peer]
fkchang has joined #opal
elia has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
DrShoggoth has joined #opal
DrShoggoth has quit [Read error: Connection reset by peer]
dimaursu16 has quit [Ping timeout: 260 seconds]
mneorr has quit [Remote host closed the connection]
mneorr has joined #opal
mneorr has quit [Ping timeout: 272 seconds]
dimaursu16 has joined #opal