| Store | Cart

Re: [TCLCORE] CFV: TIPs 351 and 475

From: Donald G Porter <dona...@nist.gov>
Thu, 22 Feb 2018 12:20:01 -0500
On 02/22/2018 04:39 AM, Dipl. Ing. Sergey G. Brester via Tcl-Core wrote:
> One question I still have - should we really use completely new > bytecode-instruction for the insert,> doing almost the same as the string replace (INST_STR_REPLACE)?> Even if there is the common routine now, that used for both processes.> > I mean would be possibly my continuation of this branch better eligible > for the TIP?
I do like your approach better with a single instruction plus a
parameter argument, and I agree that continuing your branch is a good
way to bring that forward.

What we cannot do is incompatibly change the way bytecode instruction
177 (INST_STR_REPLACE) functions.

The new approach has to be created as a new instruction, which it
appears would be bytecode 190.  At that point, all generated bytecode
would use only the new instruction, and the legacy instruction would
only exist to support bytecode brought into an interp via tbcload.  This
is just like the instructions INST_LOR, INST_LAND, INST_CALL_FUNC1,
and probably several more already in legacy status.

On the trunk (Tcl 9.0a0), I see that instructions 
INST_CALL_BUILTIN_FUNC1 (62) and INST_CALL_FUNC1 (63) have already been
removed -- I think in pursuit of TIP 495 "Remove Deprecated API". It
looks to me like there's more that can go, and unless there's objection
I think we should take TIP 495 as permission to do so.

So, I think on the sebres-string-insert-cr1 branch, we shift the
bytecode work to instruction 190, restore/revise the legacy instruction
177, and then make the other revisions to Tcl_ReplaceObj() -> 
Tcl_StringReplace().  I think the result will be what a TIP 475
implementation should look like.

We can address the further improvements that stricter encoding will
make possible whenever we commit to that change as a separate question.
That will be easier to do with the implementation all contained in a
single routine.

-- | Don Porter            Applied and Computational Mathematics Division |
| dona...@nist.gov             Information Technology Laboratory |
| http://math.nist.gov/~DPorter/                                  NIST |
|______________________________________________________________________|

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Tcl-Core mailing list
Tcl-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcl-core
Recent Messages in this Thread
Kevin Kenny Feb 21, 2018 03:22 am
Kevin Kenny Feb 21, 2018 05:47 pm
Brian Griffin Feb 21, 2018 06:13 pm
Donald Porter Feb 21, 2018 10:43 pm
Dipl. Ing. Sergey G. Brester via Tcl-Core Feb 22, 2018 09:39 am
Donald G Porter Feb 22, 2018 05:20 pm
Donald G Porter Feb 22, 2018 05:00 pm
Kevin Kenny Feb 22, 2018 06:20 pm
Alexandre Ferrieux Feb 22, 2018 09:16 pm
Dipl. Ing. Sergey G. Brester via Tcl-Core Feb 22, 2018 08:41 pm
Jos Decoster Mar 01, 2018 07:36 pm
Steve Landers Feb 21, 2018 11:58 pm
Harald Oehlmann Feb 22, 2018 07:06 am
Andreas Kupries Mar 01, 2018 05:41 am
Messages in this thread