Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

All laws are simulations of reality. -- John C. Lilly


devel / comp.lang.tcl / Re: How does TCL select the bytecode engine vs interpreted engine

SubjectAuthor
* How does TCL select the bytecode engine vs interpreted enginesam appleton
+- How does TCL select the bytecode engine vs interpreted engineDon Porter
`- How does TCL select the bytecode engine vs interpreted engineAshok

1
How does TCL select the bytecode engine vs interpreted engine

<771d7d85-b057-40ef-9355-da734379c5ean@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12299&group=comp.lang.tcl#12299

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ac8:710c:0:b0:417:9205:acc8 with SMTP id z12-20020ac8710c000000b004179205acc8mr170162qto.6.1698089255540;
Mon, 23 Oct 2023 12:27:35 -0700 (PDT)
X-Received: by 2002:a05:6808:118:b0:3ae:5aab:a6f3 with SMTP id
b24-20020a056808011800b003ae5aaba6f3mr3050984oie.5.1698089255208; Mon, 23 Oct
2023 12:27:35 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Mon, 23 Oct 2023 12:27:34 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=24.130.231.224; posting-account=49CsEAoAAACsz5aklDz9S96SFJLF_ZxF
NNTP-Posting-Host: 24.130.231.224
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <771d7d85-b057-40ef-9355-da734379c5ean@googlegroups.com>
Subject: How does TCL select the bytecode engine vs interpreted engine
From: sam.s.ap...@gmail.com (sam appleton)
Injection-Date: Mon, 23 Oct 2023 19:27:35 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1793
 by: sam appleton - Mon, 23 Oct 2023 19:27 UTC

Hiya All,

We are facing some difficulties in the behavior of TCL between the "non-bytecode" execution vs bytecode execution,
for since

Tcl_LappendObjCmd
vs.
TclCompileLappendCmd

How does TCL determine whether it's going to "compile" input or just
interpret it - and is there any way to "force" one way or the other (dynamically)
for testing purposes? For our testing, we need to force the two paths through the
interpreter for the same input to verify that the behavior is the same. For example, in some cases we see TCL take the "interpreted" path and call Tcl_LappendObjCmd, and in other cases, it bytecompiles the input and goes through the TclCompileLappendCmd path.

Sam Appleton
Ausdia Inc.

Re: How does TCL select the bytecode engine vs interpreted engine

<uh6ioe$3bfdu$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12300&group=comp.lang.tcl#12300

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: donald.p...@nist.gov (Don Porter)
Newsgroups: comp.lang.tcl
Subject: Re: How does TCL select the bytecode engine vs interpreted engine
Date: Mon, 23 Oct 2023 15:49:34 -0400
Organization: ACMD ITL NIST
Lines: 30
Message-ID: <uh6ioe$3bfdu$1@dont-email.me>
References: <771d7d85-b057-40ef-9355-da734379c5ean@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 23 Oct 2023 19:49:34 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="34763552a6d7a93f88ae597240332fcb";
logging-data="3521982"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ZlvG1SAwhFhozcKtrnE0XI/loNX740gQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.15.0
Cancel-Lock: sha1:XdGtNJNfbVs0DJWe/mi2Gwp1dPA=
In-Reply-To: <771d7d85-b057-40ef-9355-da734379c5ean@googlegroups.com>
Content-Language: en-US
 by: Don Porter - Mon, 23 Oct 2023 19:49 UTC

On 10/23/23 15:27, sam appleton wrote:
> Hiya All,
>
> We are facing some difficulties in the behavior of TCL between the "non-bytecode" execution vs bytecode execution,
> for since
>
> Tcl_LappendObjCmd
> vs.
> TclCompileLappendCmd
>
> How does TCL determine whether it's going to "compile" input or just
> interpret it - and is there any way to "force" one way or the other (dynamically)
> for testing purposes? For our testing, we need to force the two paths through the
> interpreter for the same input to verify that the behavior is the same. For example, in some cases we see TCL take the "interpreted" path and call Tcl_LappendObjCmd, and in other cases, it bytecompiles the input and goes through the TclCompileLappendCmd path.
>
>
> Sam Appleton
> Ausdia Inc.

Use the TCL_EVAL_DIRECT flag to Tcl_EvalObjEx() to forbid use of
bytecode.

https://www.tcl.tk/man/tcl8.6/TclLib/Eval.html

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

Re: How does TCL select the bytecode engine vs interpreted engine

<uh7jju$3m75e$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12303&group=comp.lang.tcl#12303

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: apnmbx-p...@yahoo.com (Ashok)
Newsgroups: comp.lang.tcl
Subject: Re: How does TCL select the bytecode engine vs interpreted engine
Date: Tue, 24 Oct 2023 10:40:23 +0530
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <uh7jju$3m75e$1@dont-email.me>
References: <771d7d85-b057-40ef-9355-da734379c5ean@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 24 Oct 2023 05:10:23 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="70aa6db875b57db84b7012910caed655";
logging-data="3873966"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/f2Htgj86Jl1/AwwKnQqUb"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Cancel-Lock: sha1:vae2RXScKrwcGhTf/t2u2BCKhP8=
In-Reply-To: <771d7d85-b057-40ef-9355-da734379c5ean@googlegroups.com>
Content-Language: en-US
 by: Ashok - Tue, 24 Oct 2023 05:10 UTC

At a script level, I believe the following three cases are necessary to
exercise all code paths. Using lappend as an example

1. Compiled with a local variable table (or use apply instead of
defining a proc)
proc testlappend {} {
lappend L a b c
} testlappend

2. Compiled without a local variable table
lappend L a b c

3. Uncompiled
set testcmd lappend
$testcmd L a b c

Corrections from Tcl bytecode gurus welcome

/Ashok

On 10/24/2023 12:57 AM, sam appleton wrote:
> Hiya All,
>
> We are facing some difficulties in the behavior of TCL between the "non-bytecode" execution vs bytecode execution,
> for since
>
> Tcl_LappendObjCmd
> vs.
> TclCompileLappendCmd
>
> How does TCL determine whether it's going to "compile" input or just
> interpret it - and is there any way to "force" one way or the other (dynamically)
> for testing purposes? For our testing, we need to force the two paths through the
> interpreter for the same input to verify that the behavior is the same. For example, in some cases we see TCL take the "interpreted" path and call Tcl_LappendObjCmd, and in other cases, it bytecompiles the input and goes through the TclCompileLappendCmd path.
>
>
> Sam Appleton
> Ausdia Inc.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor