Nathan-Wall / proto

A programming language derived from JavaScript which emphasizes prototypes, integrity, and syntax.
Other
12 stars 1 forks source link

Run modules in separate realms #63

Open Nathan-Wall opened 10 years ago

Nathan-Wall commented 10 years ago

Currently any two modules have a global communication channel available through any of the global objects. This isn't good. There are at least 3 possible solutions.

  1. Run each module in its own realm. As I understand it, this will be the approach taken by ES6.
  2. Freeze the globals to prevent modification.
  3. Require importing everything -- remove the concept of "globals" from the language. (Note that with a good module loader system, requiring the built-ins to be imported would make preventing communication possible, and in fact would give people the choice to choose option 1 or 2 by setting it up in the module loader.)

At this point any of these options sound promising. I've been working under the assumption that option 1 would be the direction we went, but the other options should be considered as well.

What should we do?