I'm not exactly sure what the protocol should be, but @shivamkakkar brought up the good point that the error handling in spawn isn't complete. Right now we eagerly try to execute whatever the user wants, even if that thing ends up being a non-Browsix javascript or text file.
We should have a protocol whereby we launch a worker, send it the init message, and wait for a reply. If we don't get a reply in < $N milliseconds, we kill it and report an error. I'm open to other proposals, too.
I'm not exactly sure what the protocol should be, but @shivamkakkar brought up the good point that the error handling in spawn isn't complete. Right now we eagerly try to execute whatever the user wants, even if that thing ends up being a non-Browsix javascript or text file.
We should have a protocol whereby we launch a worker, send it the init message, and wait for a reply. If we don't get a reply in < $N milliseconds, we kill it and report an error. I'm open to other proposals, too.