Message from JavaScript discussions

December 2018

— Okay, let's go back. i asked for an "real-world" example, running two "prepared" functions simultaeously is okay, but if you call them synchroneous, then they generally are not prepared

Message permanent page

— 

Let's say you abstract:
f = n => n + n * n;

Now you can calculate different numbers simultaneously:

spawn f(2);
spawn f(4);

— What does "prepared" mean?

— Assuming "prepared" means async / interruptible:
HertzScript makes EVERY function "prepared"

— Will not collide, may be run in any order, etc

— Not simultaneously, concurrently

— Yes

— That depends on the caller

— 

var f = hzUserLib.hookArrowCoroutine(function*(n) {
(yield hzUserLib.returnValue([(yield hzUserLib.add([n, (yield hzUserLib.multiply([n, n]))]))]));
});

Message permanent page

— It does not do this currently but it is planned

— So that even the most granular atoms of an expression can be interrupted

— It means math operations from other functions could be interlaced in the time frame it takes to execute all of them

Message permanent page