These are chat archives for voodooattack/nexusjs

5th
May 2016
Rares Golea
@rgolea
May 05 2016 19:16 UTC
here you go guys
a basic explanation of node.js
jtenner
@jtenner
May 05 2016 19:16 UTC
HAHAHAHAHA
Rares Golea
@rgolea
May 05 2016 19:16 UTC
basically
Abdullah A. Hassan
@voodooattack
May 05 2016 20:10 UTC
Oh god
i almost died laughing
Rares Golea
@rgolea
May 05 2016 20:11 UTC
:)
Abdullah A. Hassan
@voodooattack
May 05 2016 20:15 UTC
I'm still laughing uncontrollably
my family thinks I'm crazy
Rares Golea
@rgolea
May 05 2016 20:15 UTC
:)
jtenner
@jtenner
May 05 2016 20:15 UTC
Javascript is crazy
Rares Golea
@rgolea
May 05 2016 20:15 UTC
well… it’s sooo trueee
jtenner
@jtenner
May 05 2016 20:18 UTC
This is totally relevant
Look it mentions SharedArrayBuffer
Abdullah A. Hassan
@voodooattack
May 05 2016 20:20 UTC
Lol
jtenner
@jtenner
May 05 2016 20:20 UTC
@voodooattack you don't understand, My game framework utilizes ArrayBuffers. This could be HUGE.
If I can push a SharedArrayBufferbeforehand to a worker, all I have to do is set some data in a typed array in a web worker.
Rares Golea
@rgolea
May 05 2016 20:21 UTC
SharedArrayBuffer not found.
jtenner
@jtenner
May 05 2016 20:21 UTC
That's because it's a new technology....
NOTE: To run the demos in this post you’ll need Firefox 46 or later. You must also set the preference javascript.options.shared_memory to true in about:config unless you are running Firefox Nightly.
Rares Golea
@rgolea
May 05 2016 20:23 UTC
great… here I was thinking that I was starting to finish the bumpy ride that learning js was… and that now I just have to keep up…
:)
jtenner
@jtenner
May 05 2016 20:23 UTC
It's not really complicated
Float32Array uses an ArrayBuffer in the background.
Rares Golea
@rgolea
May 05 2016 20:24 UTC
i don’t know ANYTHING about other types of arrays than the new Array() and [ ]
:smile:
Wasn’t really concerned about it until now
jtenner
@jtenner
May 05 2016 20:24 UTC
var SAB = new SharedArrayBuffer(4 * Length);
var typedArray = new Float64Array(SAB);
Abdullah A. Hassan
@voodooattack
May 05 2016 20:24 UTC
8*
jtenner
@jtenner
May 05 2016 20:24 UTC
When you post this message to a webworker, both sides now retain access to the buffer. Remember how I said it was a one-way trip?
Float64 uses 4 bytes :)
I'm almost positive
Abdullah A. Hassan
@voodooattack
May 05 2016 20:25 UTC
8
4 is 32 bit
jtenner
@jtenner
May 05 2016 20:26 UTC
Oh I've been working with 32bit stuffs
I got it confused
Abdullah A. Hassan
@voodooattack
May 05 2016 20:26 UTC
hehe
jtenner
@jtenner
May 05 2016 20:26 UTC
blob
Abdullah A. Hassan
@voodooattack
May 05 2016 20:26 UTC
we all do
yep
jtenner
@jtenner
May 05 2016 20:27 UTC
But really. This changes the way my framework works!
I can opt into a Parallel version that keeps in sync without postMessage()
Abdullah A. Hassan
@voodooattack
May 05 2016 20:27 UTC
ah yes
once all browsers implement it
jtenner
@jtenner
May 05 2016 20:27 UTC
No you "opt" into it
have both versions, but opt into it when SharedArrayBuffer is defined.
That way, if the browser implements it, you get the faster version by design.
Abdullah A. Hassan
@voodooattack
May 05 2016 20:28 UTC
hmm. Maybe
jtenner
@jtenner
May 05 2016 20:29 UTC
Adding further to that complexity, the main thread of a web page is not allowed to call Atomics.wait because it is not good for the main thread to block. So while workers can communicate among themselves using Atomics.wait and Atomics.wake, the main thread must instead listen for an event when it is waiting, and a worker that wants to wake the main thread must post that event with postMessage.
This is apparently a thing already in browsers.
People who are afraid of atomics in Nexus are looking for a reason to be scared LOL
Abdullah A. Hassan
@voodooattack
May 05 2016 20:30 UTC
Hehe
That's so true
jtenner
@jtenner
May 05 2016 20:32 UTC
SharedArrayBuffer puts less work on the main thread. I'm so hyped. I hope it works out.
Abdullah A. Hassan
@voodooattack
May 05 2016 20:34 UTC
I think nexus already has that btw
JavaScriptCore <3
jtenner
@jtenner
May 05 2016 20:36 UTC
Hmm
Really?
That's amazing
I really need nexus-webkit already XD
Abdullah A. Hassan
@voodooattack
May 05 2016 20:36 UTC
Haha
Awesome article.
Abdullah A. Hassan
@voodooattack
May 05 2016 20:40 UTC
Looks interesting. I'll read it at home.
This is a really good read and example.
Rares Golea
@rgolea
May 05 2016 21:32 UTC
Idk man... This is waaay over my head... It's late hours though and I haven't slept for more than 36hrs...
jtenner
@jtenner
May 05 2016 21:32 UTC
Good night man.
:D
Rares Golea
@rgolea
May 05 2016 21:32 UTC
anyways... Try doing a tutorial or something with a practical use case... I can't currently find one...
not this late anyways
:)
or the benefits from this type of array to a normal js array
jtenner
@jtenner
May 05 2016 21:33 UTC
The array isn't different, it's the Buffer that's different
Rares Golea
@rgolea
May 05 2016 21:33 UTC
Or the buffer
anyways
gotta go... I won't fit any more info in my head today
jtenner
@jtenner
May 05 2016 21:34 UTC
yeah I know exactly what you mean.
Rares Golea
@rgolea
May 05 2016 21:34 UTC
:smile:
jtenner
@jtenner
May 05 2016 21:34 UTC
Good night!
Rares Golea
@rgolea
May 05 2016 21:34 UTC
thnx
u guys as well
Abdullah A. Hassan
@voodooattack
May 05 2016 21:36 UTC
Good night :)