JavaScript Containers
There&#x27;s a lot more to unpack from this concept than Ryan&#x27;s post is letting on. I&#x27;m seeing a lot of negative sentiment, largely focused on negative opinions towards JavaScript.<p>This is entirely besides the point. The emphasis is mostly on V8, which we all know is first and foremost a JavaScript engine. But it is also a WebAssembly engine, meaning several languages beyond JavaScript can execute with the approach he&#x27;s talking about.<p>What the post doesn&#x27;t really go into detail on is how V8 is arguably the most secure runtime in the world. The browser runtime is one of the most battle tested pieces of software ever built. At its core, it enables remote code execution <i>on anyone&#x27;s machine</i>. It has a robust security model. Your program can&#x27;t do whatever it wants on the host operating system, unless granted by the user.<p>Docker Containers were an improvement over Virtual Machines by enabling dependency snapshots and compiled programs on top of an OS. V8 Isolates (translation: chrome tabs) are an improvement over Containers. Cloudflare&#x27;s discovery here is what enabled them to build their edge network. With a containerized server deploy, you can execute dozens of concurrent, isolated V8 programs without needing to spin up a new container for each of them. The server also has complete control over execution time and memory. If a V8 program consumes more than its budget, it can easily be terminated.<p>Runtime performance concerns about JavaScript are also misguided. With Rust, it&#x27;s easier than ever to write native functions that can be executed in JS or WASM. Extending the V8 codebase has historically been so difficult that most people don&#x27;t even consider it a possibility. With Deno&#x27;s V8 bindings, snapshots, and core crates, anyone can extend the language ecosystem with relative ease. Programs operating in this model on the edge have already shown to be significantly more performant than their traditional server deploy counterparts. End-to-end latency is all but eliminated, until that edge program needs to fetch data from a datacenter. And for that, the &quot;global state&quot; problem is aggressively being worked on by the major edge providers (sorry Cloudflare KV, we&#x27;re having a hard time <i>relating</i> with you). Once this has been solved, the web is prepared for some serious optimization.<p>If you still think &quot;the edge&quot; is a fad in 2022, I&#x27;d recommend spending more time learning about it. It&#x27;s not just JavaScript. Ironically, this architecture is the <i>solution</i> to the web&#x27;s JavaScript problem, and will be the demise of heavy clients and SPAs.