Message from JavaScript discussions

January 2019

— We compile two functions, or co-rutines


For example the statues example, there is one dispatcher interleaving the execution of two functions, right? and this dispatcher code gets embedded into the script after compiling it, right? so in my opinion we can use a dispatcher per thread, so each real thread runs multiple functions at same time, but you also run multiple dispatchers with other functions. With this approach it would be easier to implement..

— Now the thing is, do you want communication between threads through callback? or do you want to use channels?

in any of both cases dispatcher must have a way to hook into it from outside, in order to give the control to the host (metacall) and deal with control mechanisms like channels or execute the protected callbacks with a copy like fp

Message permanent page

— What about shared state?

— It's like the channel, the channel, channel is used to block in order to protect data or code

— Hummmmm

— The alternative are callbacks like fp or message passing

— There are more but I'm thinking something easy to implement in order to do a PoC and show an example of how to implement protothreads with OS threads, and auto-thread js code

Message permanent page

— A combination of async and co-routines can be awesome, async for the I/O thread pool and spawn for V8 thread pool, I think it can even be done without need of metacall, only with nodejs

Message permanent page

— How do you come to your metacall? why you think it will be useful and where?

— I started js to build an app for accounting.. and now im here🤤

— Jezuz, its not even close to the start point