News for hackers. Stuff that matters.
Re:Jaspy – A Python VM written in JavaScript by chrisseaton on Saturday April 16, 2016 @05:55PM (#11512429)
It's easy: you could just run n instructions of thread one, then n instructions of thread two, and so on in a loop. To not freeze up the browser, you could periodically yield to it and set a timeout to start running the next thread again.
Re:Jaspy – A Python VM written in JavaScript by foota on Sunday April 17, 2016 @05:31PM (#11516412)
I guess so. I think I was thinking about concurrently running multiple threads.
Re:Jaspy – A Python VM written in JavaScript by chrisseaton on Sunday April 17, 2016 @06:59PM (#11516741)
That is already concurrent. Do you mean in parallel? Yeah not easy to do that, you'd have to set up web workers and I think sort of manually recreate the shared state with your own coherence protocol!