Obviating init.tcl



Whenever [interp create] creates a non-safe interpreter, it goes
through a quite costly initialization process potentially involving
regexps, file system access, $env access - all to source a file
init.tcl which is around 850 lines of tcl.

That's *every* time.

That's a lot of overhead which may be obviated in some cases.

I have two alternatives:

1) expose the C variable tclPreInitScript to tcl, enabling tcl scripts
to avoid the init.tcl process.

2) add a -minimal option to [interp create] which skips all the default
stuff.

I imagine this would make [interp create] a *lot* more lightweight.

Colin.

.



Relevant Pages

  • Re: Executing an expr from a C code --- Tcl_ParseCommand
    ... // the expression _exprStr should use a tcl double variable called ... // try to parse the expr ... that are freed when deleting the interp? ... tcl expr command to let my users compute some mathematical expression. ...
    (comp.lang.tcl)
  • Re: Scripting in Tcl?
    ... >>>Is there any scripting engine in pure Tcl, ... Why not just expose Tcl (or a safe Tcl ... interp create ex0 -safe ... % interp eval ex0 { ...
    (comp.lang.tcl)
  • Re: how to run interp on multiple inputs?
    ... and [interp eval] that script in an interp that was ... > in approximately 100 lines of Tcl, never writing a single line of C. ... > Tcl commands to the script sketched above. ... Jeffrey W Percival, ...
    (comp.lang.tcl)
  • Re: using interp snapshot
    ... different tcl files that perform a small monitoring tasks. ... do not want to clean the helper procs and packages. ... the interp state that is ready for sourcing a moniror file? ... packages commands known in your sub interpreter. ...
    (comp.lang.tcl)
  • Other April 1st ideas bandied around earlier today
    ... "The Tcl comunity has realized that it is indeed dead and recommends ... "California tables bill to change terminology from 'slave interp' to ... "Starkist brand tuna launches name infringement lawsuit against makers ... "Tcl objs soon to be triple-ported. ...
    (comp.lang.tcl)