Implement basic threads:
// syntax is a to-do, too, a bit
//spawns a new thread with the identifier 'myname'. Thread names are optional
thread myname {
stuff1();
stuff2();
etc();
}
join myname; //joins a thread, no-op if thread has already finished
let x = 5;
let y = 6;
// captures variables for a thread. Currently unsure if it should actually move them or just copy
// Not really sure about syntax here
thread |x, y| {
print(x);
print(y);
}
// all threads are joined when the main script thread is about to finish to prevent threads being stopped unexpectedly
Implement basic threads: