3 comments

[ 0.29 ms ] story [ 27.6 ms ] thread
Interesting take, and it makes a lot of sense. Is there an open source framework for handling isolates dedicated to serverless functionality out there?
The downside mentioned in the blog post is worth calling out:

> No technology is magical, every transition comes with disadvantages. An Isolate-based system can’t run arbitrary compiled code. Process-level isolation allows your Lambda to spin up any binary it might need. In an Isolate universe you have to either write your code in Javascript (we use a lot of TypeScript), or a language which targets WebAssembly like Go or Rust.

It’s also worth noting that for JavaScript the Workers Runtime environment [1] is more similar to the browser than to Node.js. Thus you cannot include NPM packages directly, e.g. you could not simply:

  const express = require('express')
[1]: https://developers.cloudflare.com/workers/reference/apis/sta... "Workers Runtime APIs"
In practice you can use tools like Webpack to process npm imports as a build step, and Cloudflare's own tooling (Wrangler) can run Webpack for you automatically.

However, it is true that npm modules that require Node.js-specific APIs won't work.

(Disclosure: I'm the tech lead for Workers.)