zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <psprint@zdharma.org>
To: "Bart Schaefer" <schaefer@brasslantern.com>,
	"zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: Question about ingetc() vs. word-code
Date: Sun, 9 Jul 2017 09:25:42 +0200	[thread overview]
Message-ID: <etPan.5961da76.2ca9be47.4e4d@zdharma.org> (raw)
In-Reply-To: <CAH+w=7YdUoZ8eM2=7-RgzEz2Gt7e1-kQZfyU-6-=XAjXiGzvog@mail.gmail.com>

On 08.07.2017 at 23:42:59, Bart Schaefer (schaefer@brasslantern.com) wrote:
> > Why the compiled, not-eval source still exist in hunks in ingetc() input? Many times.  
> The eval-code also appears, but this is probably expected.
>  
> The compiled wordcode includes all the original text of most strings
> and identifiers, so that XTRACE and VERBOSE output can be properly
> reproduced. Only shell lexical tokens are turned into numeric codes.
> Identifiers that are referenced as well as assigned will appear at
> each $NAME expansion or function name call.

Ok, got it. I also think that I understand why stringsubst(), prefork(), etc. are called that often – to decode flags, perform substitution, obtain actual value.

> A possible optimization for compiling whole digests of related
> functions would be to build an identifier dictionary and refer to the
> identifiers by a wordcode value followed by an offset into the
> dictionary, but this would be wasteful for most small/single-function
> compilations and would complicate the XTRACE playback.

I'm thinking about converting WC_SUBLIST to WC_SUBLIST_SIMPLE. Comment in parse.c says *_SIMPLE lists are executed faster. But the topic is difficult, and I'm not having much time, so my tempo for this is low. I think this might be related to has_token(), to simple actions (not sure if could write "simple lists" here) instead of prefork(), etc. But unsure if current token-detection is over-possitive. If I could simplify word-code, it would lead to situation, where normal Zsh compilation does things in stable way, while Zplugin's compilation would do things in hackish way, possibly for specific functions only. So both ways would be meaningful, could exist concurrently.

--  
Sebastian Gniazdowski
psprint /at/ zdharma.org


      reply	other threads:[~2017-07-09  7:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-05 11:37 Sebastian Gniazdowski
2017-07-08 21:42 ` Bart Schaefer
2017-07-09  7:25   ` Sebastian Gniazdowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=etPan.5961da76.2ca9be47.4e4d@zdharma.org \
    --to=psprint@zdharma.org \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).