These are chat archives for opal/opal

13th
Dec 2015
giuan
@giuan
Dec 13 2015 09:43

ARGV is empty with opal runner or with node.
I solved the problem with

if RUBY_ENGINE == 'opal'
  argv = []
  `argv = process.argv.slice(2)`
  ARGV = argv
end

There is another method?

Elia Schito
@elia
Dec 13 2015 09:52
You can assign ARGV directly
giuan
@giuan
Dec 13 2015 10:50
@elia why don't you set ARGV in the init code? I'am not able to do the job!
Alexandr Smirnov
@JelF
Dec 13 2015 11:05
@giuan +
Mitch VanDuyn
@catmando
Dec 13 2015 16:18
@/all way off topic but - for the nth time somebody asked a question that I have been struggling with for a long time regarding syncing database queries across multiple clients. If any anybody is interested or feels they could help with this, please join the conversation here: https://gitter.im/catprintlabs/reactive-record
Elia Schito
@elia
Dec 13 2015 18:14
@giuan require nodejs/kernel
Martin Becker
@Thermatix
Dec 13 2015 18:37
how do I execute an iterative code block in parallel instead of in serial
Elia Schito
@elia
Dec 13 2015 18:38
You're limited to evented, js has no threads
also depends on the platform I think
it's probably best to look for some nodejs tutorial on the topic and port it to ruby/Opal
Martin Becker
@Thermatix
Dec 13 2015 18:43
what about async code? isn't that in parallel
meh.
@meh
Dec 13 2015 18:43
Thermatix, nope
Thermatix, js is single-threaded
async functions run when nothing else is running
Martin Becker
@Thermatix
Dec 13 2015 18:44
hmm I see I think that's what I meant :)
async
soooo how do I do aync code in opal?
meh.
@meh
Dec 13 2015 18:45
Thermatix, then just use a setTimeout to do each iteration
Martin Becker
@Thermatix
Dec 13 2015 18:47
?
Elia Schito
@elia
Dec 13 2015 18:49
@Thermatix just a random result form google: http://fitzgeraldnick.com/weblog/35/ but should explain what you need
MichaƂ Kalbarczyk
@fazibear
Dec 13 2015 18:53
Quick 1 day project in opal :) https://inesita-asciify-me.netlify.com/
Martin Becker
@Thermatix
Dec 13 2015 18:55
ok... that is coool! but do Matrix version! with falling letters!
Elia Schito
@elia
Dec 13 2015 18:55
sounds a legit request, coming from Thematrix itself! :D
Martin Becker
@Thermatix
Dec 13 2015 18:57
Why do I get the feeling there's a joke in there somewhere...
Elia Schito
@elia
Dec 13 2015 18:57
@fazibear super cool btw :clap:
Martin Becker
@Thermatix
Dec 13 2015 18:57
it is!
I'm thinking that I don't need async, it should work fine, one after another :P
it would be better if it worked in parallel but execution happen so quick that it shouldn't be an issue
giuan
@giuan
Dec 13 2015 21:21
@Elia thanks
Elia Schito
@elia
Dec 13 2015 21:21
:+1:
Martin Becker
@Thermatix
Dec 13 2015 21:49
oh and I've almost finished my opal based router, it only needs history
Other than that though, it supports what you need to build a site ,
Elia Schito
@elia
Dec 13 2015 23:44
@vais @meh I think this can potentially remove lots of pain opal/opal@6044d30 (and close a number of issues too!)
meh.
@meh
Dec 13 2015 23:45
looks good
Elia Schito
@elia
Dec 13 2015 23:46
Now (in that branch) class creation is reduced to 2 Opal runtime helpers + setting $$super and $$parent and creating the scope