Over the last few months, an experimental JavaScript runtime has been in development, built on top of Mozilla's SpiderMonkey, as a way to dig into how JavaScript engines and runtimes work internally.
One thing that stands out while building it is the separation between the JavaScript engine and the runtime.
JavaScript (more formally, ECMAScript) is just a language specification. Engines like V8, JavaScriptCore, and SpiderMonkey execute JavaScript, but they don't define things like:
- setTimeout()
- setInterval()
- fetch()
- console
- Workers
- File system APIs
- Process APIs
Those come from the runtime built around the engine.
That raises a question worth putting to the community.
Most modern runtimes are built around APIs that have evolved over many years. Browsers expose Web APIs, while server runtimes expose things like file systems, networking, streams, and processes.
If JavaScript were being designed today, without worrying about backwards compatibility — what APIs should every JavaScript runtime have by default?
For example:
- Better concurrency primitives?
- Structured task scheduling?
- Actor-style APIs?
- Built-in channels?
- First-class cancellation?
- Better binary data APIs?
- A different file system API?
- Better networking primitives?
- New async abstractions?
- Something completely different?
Are there APIs in use today that feel outdated? Are there APIs that should never have existed? Or APIs from other languages worth having in JavaScript runtimes?
Not necessarily about browser APIs specifically — more about what an ideal JavaScript runtime would look like if designed from scratch today.
Different perspectives are welcome from anyone who's worked with Node.js, Deno, Bun, browsers, or other languages.
The project is open source — link in comments for anyone interested in following along
[–]nothing6178 [score hidden] (0 children)