ECMAScript spec proposal for Realms API

# What are Realms?

A realm object abstracts the notion of a distinct global environment, with its own global object, copy of the standard library, and "intrinsics" (standard objects that are not bound to global variables, like the initial value of Object.prototype). page

YOUTUBE tuMG7688Ndw Frozen Realms: Proposed Standard Support for Safer JavaScript Plugins

# Intuitions - sandbox - iframe without DOM - principled version of Node's 'vm' module - sync Worker

# Use cases - security isolation (with synchronous but coarse-grained communication channel) - plugins (e.g., spreadsheet functions) - in-browser code editors - server-side rendering - testing/mocking (e.g., jsdom) - in-browser transpilation

# Shim - A shim implementation of the Realm API can be found here . - And you can play around with the Shim here .

# JS dialects with ES6 Realms - This essay explains how the ES6 Realm API makes it possible to create robust language abstractions that allow hooking into the behavior of eval, and how this can be used to implement different dialects of JavaScript: gist

# ECMAScript Realms Spec Proposal - rendered in html - on github proposal