Fwd: twin interpreters in safe-tcl, but in Python?

Bill Janssen (janssen@parc.xerox.com)
Fri, 17 Jun 1994 19:39:06 PDT

OK, here's a fun one. Can this be done in Python?

---------- Forwarded message begins here ----------

Date: Fri, 17 Jun 1994 13:43:56 -0700
From: "Brent Welch" <welch@parc.xerox.com>
Subject: twin interpreters in safe-tcl

One point of clarification about today's talk [on Safe-Tcl]:
I used the term "twin TCL interpreters", and John Ellis
pointed out that "twin interpreter contexts" would be
a better phrasing. There is, in fact, just one lump
of C code that implements the TCL interpreter. One of
its library calls is
which creates a new instance of a TCL interpreter context.
In Safe-Tcl, two such contexts are created. The untrusted
context has the nasty commands removed from its dictionary
of commands, and a limited set of new primitives added to
its command set. The other context has all the standard
TCL (and TK) commands, plus some additional commands to
extern control over the untrusted interpreter context.
Each context also has its own set of TCL variables that
are completely disjoint from each other (unless you create
a primitive that ties TCL variables from different contexts
Brent Welch