Google V8 Javascript Engine: Platform, Isolate and Context. What are they for?

This is a question I found myself asking again and again while finding my way around Google’s V8 Javascript engine.

What’s the difference between an Isolate and a Context? (and, for that matter, a Platform?)

A Platform captures the global initialization for V8. You need one, and you only ever need exactly one.

An Isolate can only be accessed by one thread at a time. If you are writing a single-threaded application, you can get away with only one Isolate. Objects from one Isolate must not be used in another Isolate.

A Context keeps each distinct “application” in it’s own “namespace”. You can freely pass objects between Contexts.

See also: