These are chat archives for voodooattack/nexusjs

5th
May 2016
Rares Golea
@rgolea
May 05 2016 19:16
here you go guys
a basic explanation of node.js
jtenner
@jtenner
May 05 2016 19:16
HAHAHAHAHA
Rares Golea
@rgolea
May 05 2016 19:16
basically
Abdullah A. Hassan
@voodooattack
May 05 2016 20:10
Oh god
i almost died laughing
Rares Golea
@rgolea
May 05 2016 20:11
:)
Abdullah A. Hassan
@voodooattack
May 05 2016 20:15
I'm still laughing uncontrollably
my family thinks I'm crazy
Rares Golea
@rgolea
May 05 2016 20:15
:)
jtenner
@jtenner
May 05 2016 20:15
Javascript is crazy
Rares Golea
@rgolea
May 05 2016 20:15
well… it’s sooo trueee
jtenner
@jtenner
May 05 2016 20:18
This is totally relevant
Look it mentions SharedArrayBuffer
Abdullah A. Hassan
@voodooattack
May 05 2016 20:20
Lol
jtenner
@jtenner
May 05 2016 20:20
@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
SharedArrayBuffer not found.
jtenner
@jtenner
May 05 2016 20:21
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
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
It's not really complicated
Float32Array uses an ArrayBuffer in the background.
Rares Golea
@rgolea
May 05 2016 20:24
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
var SAB = new SharedArrayBuffer(4 * Length);
var typedArray = new Float64Array(SAB);
Abdullah A. Hassan
@voodooattack
May 05 2016 20:24
8*
jtenner
@jtenner
May 05 2016 20:24
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
8
4 is 32 bit
jtenner
@jtenner
May 05 2016 20:26
Oh I've been working with 32bit stuffs
I got it confused
Abdullah A. Hassan
@voodooattack
May 05 2016 20:26
hehe
jtenner
@jtenner
May 05 2016 20:26
blob
Abdullah A. Hassan
@voodooattack
May 05 2016 20:26
we all do
yep
jtenner
@jtenner
May 05 2016 20:27
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
ah yes
once all browsers implement it
jtenner
@jtenner
May 05 2016 20:27
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
hmm. Maybe
jtenner
@jtenner
May 05 2016 20:29
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
Hehe
That's so true
jtenner
@jtenner
May 05 2016 20:32
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
I think nexus already has that btw
JavaScriptCore <3
jtenner
@jtenner
May 05 2016 20:36
Hmm
Really?
That's amazing
I really need nexus-webkit already XD
Abdullah A. Hassan
@voodooattack
May 05 2016 20:36
Haha
Awesome article.
Abdullah A. Hassan
@voodooattack
May 05 2016 20:40
Looks interesting. I'll read it at home.
This is a really good read and example.
Rares Golea
@rgolea
May 05 2016 21:32
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
Good night man.
:D
Rares Golea
@rgolea
May 05 2016 21:32
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
The array isn't different, it's the Buffer that's different
Rares Golea
@rgolea
May 05 2016 21:33
Or the buffer
anyways
gotta go... I won't fit any more info in my head today
jtenner
@jtenner
May 05 2016 21:34
yeah I know exactly what you mean.
Rares Golea
@rgolea
May 05 2016 21:34
:smile:
jtenner
@jtenner
May 05 2016 21:34
Good night!
Rares Golea
@rgolea
May 05 2016 21:34
thnx
u guys as well
Abdullah A. Hassan
@voodooattack
May 05 2016 21:36
Good night :)