Re: vislivecode slightly ot rambles (was Re: [livecode] another ramble)

From: Robert Shelton <rshelton_at_cs.mu.OZ.AU>
Date: Sat, 22 May 2004 02:19:58 +1000

On Thu, May 20, 2004 at 11:06:04PM +0100, alex wrote:
> On Thu, 2004-05-20 at 22:40, Amy Alexander wrote:
> > 1) how do you go about telling the interpreter "execute now" when live
> > coding? dave, you're using highlighting? does it execute as soon as you
> > highlight? or you have to hit RETURN or something?
>
> I have Perl recompile the whole file I'm editing all the time. State is
> preserved - it's just interpreting it as an extra bit of code, except
> old versions of sub-routines get replaced with real ones.
>
> I have two modes... One is to have the interpreter run over the code
> every time I type any key, or every time the running program edits its
> own code. This mode is of course completely impractical as you have to
> think of the effect of every single keypress. It also uses a lot of
> CPU, so I can't keep many running at a time without getting audio
> drop-outs... This is because my programs tend to edit their code a lot,
> putting in comments to let me know what's going on.
*snip*

This sounds like the best call for me to make some noise. :)

I'm spending a lot of time at the moment with trying to work out a
nice way of handling reparsing after every keystroke. One hope of
this is that a chain could be established to avoid having to make
a key press to refresh. The aim would be to reduce the effect of
each key press because:

        XXXX only disturbs the lexer when a character changes.

        The lexer only disturbs the parser when a token is changed.

        The parser only disturbs YYY when the parse tree is error
        free.

In this way errors don't get propogated along the compiler pipeline
and hopefully edits which don't change tokens will get done localy
by the lexer and nothing else will be disturbed.

I have not got any good test data (any suggestions for per character
edit logs of source files) but the current code would seem to be
reasonably fast, of course parsing seems to me like the easy part of
incremental compilation.

Cheers,
Rob.
Received on Fri May 21 2004 - 16:20:12 BST

This archive was generated by hypermail 2.4.0 : Sun Aug 20 2023 - 16:02:24 BST