Message from JavaScript discussions

December 2018

— The actual equation itself executes identically to regular JS code


When a yield happens, another function gets a chance to run a chunk of work, then control is returned to the first function

— If you wanted to run specific parts concurrently, you do:

spawn chunkOne();
spawn chunkTwo();

— Read what I wrote man

— Otherwise,

run as normally expected

— ^ does this look simultaneous?

— 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

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);

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