runtimejs / runtime

[not maintained] Lightweight JavaScript library operating system for the cloud
http://runtimejs.org
Apache License 2.0
1.93k stars 128 forks source link

discussion: cloudflare workers #157

Closed austinfrey closed 4 years ago

austinfrey commented 5 years ago

@iefserge I hope it's ok to continue dropping some discussion topics here.

I was doing a bit more research into v8 Isolates and Contexts and stumbled across an explanation of Cloudflare's new Workers platform and can't help but draw some parallels with runtimejs or at least what runtime was when it was supported multiple isolates.

from the article:

What we ended up settling on was a technology built by the Google 
Chrome team to power the Javascript engine in that browser, V8: Isolates.

Isolates are lightweight contexts that group variables with the code allowed 
to mutate them. Most importantly, a single process can run hundreds or 
thousands of Isolates, seamlessly switching between them. They make it
possible to run untrusted code from many different customers within a single
operating system process. They’re designed to start very quickly (several 
had to start in your web browser just for you to load this web page), and to 
not allow one Isolate to access the memory of another.

Is this where runtime was headed? what might it take to allow runtimejs to operate "hundreds" of isolates on the runtimejs kernel. Reading through the issues, it looks like there needs to be some refactoring/rewriting to make isolates a stable part of runtime, but what parts would those be?

cc: @facekapow @piranna

piranna commented 5 years ago

Interesting comment :-) I don't know about the internals or runtimejs, but definitely seems something to follow on :-)