These are chat archives for opal/opal

31st
Dec 2018
Jose Añasco
@merongivian
Dec 31 2018 06:56
Nevermind, seems that the issue was that the compiling step gets really heavy for the browser (when the file gets bigger ) ... so will to have search for another solution
Mitch VanDuyn
@catmando
Dec 31 2018 07:34
you could compile it on the server. You might want to look into hyperstack.org (https://gitter.im/ruby-hyperloop/chat) you could easily set up a "ServerOp" to do the compiling remotely.
BUT its not going to help too much. A server is somewhat faster, but will be shared. How slow is the compile? About how many lines of code?
Opal Hotreloader does incremental compiles on files that change, you might do something similar to limit how much gets compiled. Talk to @fkchang on details on that.
Jose Añasco
@merongivian
Dec 31 2018 09:07
Its actually not that many lines (like 70 lines of code), but generating music from code is really time dependent, even if the compilation gets a bit slow (like a half of a second slow) , it will mess up the audio (i start hearing crackles, the music stops, etc). I guess i'll have to do some kind of 'smart' compilation (selecting a peace of code that i changed, and just compile that)
kinda related to do this, has anyone tried to create an atom plugin?
i think i could use server compilation, dont have a need to share the server, will definitely check that out, thanks @catmando
Elia Schito
@elia
Dec 31 2018 10:51
I tried to do a plug-in a hundred years ago, probably everything changed since then
Have you considered running the audio stuff or the compilation in a web worker to have a different cpu/core do the job?
Jose Añasco
@merongivian
Dec 31 2018 11:13
mmm interesting, never thought using a web worker, will try that
Bernhard Weichel
@bwl21
Dec 31 2018 12:39

In opal 0.10 I could write

a = Native::Hash.new(`{a:1, b:2}`)
puts a

now with 0.11 Native::Hash is no longer defined. What is the equivalent approach to convert an object to hash?

Bernhard Weichel
@bwl21
Dec 31 2018 12:50
I found it in @elia answer to opal/opal#1719
it is now
a = Hash.new(`{a:1, b:2}`)
puts a
but I cannot find, where this change is documented :-(