Message from JavaScript discussions

December 2018

— Indeed without the use of spawn, there is no concurrency in an hz program, and it runs with the same execution style as it was before it was compiled

Message permanent page


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

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

Now you can calculate different numbers simultaneously:

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

Message permanent page

— 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