From: <apn...@ya...> - 2025-08-17 04:04:46
|
Yes, both interp clone and a “clean” interp as Don suggested would be nice. I’ve looked this some time back and concluded it was too much work, not just in implementation but in design (which of the internal interp structures will be cloned?) and test at well. I am not entirely sure cloning is even feasible in the presence of extensions that need their init functions to be called. It would be an interesting project to take on if someone has the time. /Ashok From: Brian O’Hagan <bri...@co...> Sent: Saturday, August 16, 2025 6:58 PM To: Donald Porter <d.g...@co...> Cc: apn...@ya...; Tcl Core List <tcl...@li...> Subject: Re: [TCLCORE] RFE: lazy loading of TclOO What about an interpreter clone command? It would have options for the user to decide what to include or not include. For example, -noprocs, -nolibs, -nochans, -novars, etc. This way you can config an interp as you need it, then just keep making copies of it. If done right, I would think this is the most efficient way to get new configured interpreters. Probably not the easiest option to implement though. On Aug 16, 2025, at 7:07 AM, Donald Porter via Tcl-Core <tcl...@li... <mailto:tcl...@li...> > wrote: Interp creation establishes a new interpreter initialized with the complete built-in command set, and includes the task of finding and sourcing the init.tcl file of the script library. That’s a fine default. Ashok’s proposal preserves an illusion of that, with some commands not fully realized, but still functional. Lazy loading or autoloading have long been part of the Tcl baseline. This is just a shift of that implementation detail. I think it is worth pursuing an additional option. Give programmers the option to create an empty interpreter — one with no commands, no variables, and only the global namespace. This would be a “create and fill with what you want” to be offered alongside the existing “create the standard and hack away what you find useless or dangerous”. I *think* that option would create interpreters faster, but a working implementation would need to demonstrate that. On Aug 16, 2025, at 1:59 AM, apnmbx-public--- via Tcl-Core <tcl...@li... <mailto:tcl...@li...> > wrote: I’ve logged a <https://core.tcl-lang.org/tcl/tktview/effa2e2346> RFE to improve interp creation times by lazy loading oo. Obviously, this only benefits applications that do not use oo but I believe many, and quite possibly the majority, do not. (Most of mine do so sadly would not benefit ☹). There is an accompanying branch apn-oo-lazy-init as proof of concept. >From my perspective, motivation comes from applications like web servers, where client isolation using separate interpreters would be both safer and more elegant than other approaches but suffers a significant performance loss. Looking for comments and opinions on the utility of improving interp creation times as well as the lazy implementation itself. /Ashok _______________________________________________ Tcl-Core mailing list <mailto:Tcl...@li...> Tcl...@li... <https://lists.sourceforge.net/lists/listinfo/tcl-core> https://lists.sourceforge.net/lists/listinfo/tcl-core _______________________________________________ Tcl-Core mailing list Tcl...@li... <mailto:Tcl...@li...> https://lists.sourceforge.net/lists/listinfo/tcl-core |