Paul Jolly wrote:

> > > * if Vim9 script remains experimental, presumably I have to explicitly
> > > enable it within a script it somehow/somewhere? Or is this the
> > > vim9script reference above?
> >
> > The Vim9 script syntax is only used for functions defined with ":def"
> > and for scripts that start with "vim9script".
> 
> I seem to recall from the other threads on Vim9 that the reason for
> using :def is that the changes for Vim9 script will not be backwards
> compatible.
> 
> What about the other way around? Is there a mode in which we can run
> Vim such that :function declared functions run as if declared via
> :def? And similarly for scripts, running in this mode would obviate
> the need for "vim9script"?

I do not think that is possible in general.  There will be too many
subtle differences.  And there will be a long time that the two will
exist side by side (probably forever).

I have wondered if there is a way the Vim9 syntax could be detected
automatically, but that would require scanning the whole file before
interpreting it.  It's good to state it upfront anyway.

> If not, do you have a script rewriter planned, to help people with the
> migration?

No plans, but it should not be too difficult to do the most obvious
changes, such as removing "a:" from before arguments.  It will be very
difficult to do it completely automatic, e.g. if a function is using
"a:" as a dictionary.

> > > * I'm assuming that channel support will remain the same? Is there any
> > > speed improvements we can investigate here?
> >
> > Nothing changes for channel support.  Except that when you use a ":def"
> > function to build a request or unpack a response that should be a lot
> > faster.
> 
> Thanks. The rationale behind this question and the questions above is
> me trying to work out how best we experiment with these changes with
> govim. I, and I'm sure many other people, would like to avoid having
> to rewrite existing VimScript where possible, especially whilst things
> are experimental. But at the same time it would seem to make sense to
> exercise the proposed changes as much as possible as early as
> possible.

The advantage of how it's done is that you do not *have* to rewrite
anything, but if you have some place where performance matters, you can
put that in a :def function and profit.

I imagine that when Vim9 script is supported widely enough that plugin
writers can convert the files.  Just like they would use a newly added
function.


-- 
A salesperson says:            Translation:
"backward compatible"          Old technology
"Premium"                      Overpriced
"Can't keep it on the shelf"   Unavailable
"Stands alone"                 Piece of shit
"Proprietary"                  Incompatible
                                (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202001261344.00QDidC3019208%40masaka.moolenaar.net.

Raspunde prin e-mail lui