TranslateProject/sources/news/20220629 Vim 9.0 is Here With a New Script Language Promising Performance Boost.md

4.0 KiB
Raw Blame History

Vim 9.0 is Here With a New Script Language Promising Performance Boost

Vim 9.0 update brings a new script language, promises a performance boost, and gets closer to common programming languages.

Vim, the terminal text editor is back with a major update.

The Vim 9.0 release includes several tiny improvements along with a new script language (Vim9 script).

Here, let me highlight the key changes.

Vim 9.0: Whats New?

Vim 9.0 is a significant upgrade after almost three years. And, the release announcement mentions that Vim 9.0 is more reliable than any before, which is a good thing to hear.

Some of the refinements include:

A New Vim9 Script

Vim script always ensures backwards compatibility, but that changes a bit with this update.

The backwards compatibility always comes with slower execution performance. So, with the Vim9 script, they aim to drastically improve performance.

The release note explains:

This is accomplished by compiling commands into instructions that can be efficiently executed. An increase in execution speed of 10 to 100 times can be expected.

Sounds incredible, isnt it?

However, whats the catch for these performance improvements? Heres what they say:

The performance improvements can only be achieved by not being 100% backwards compatible. For example, making function arguments available by creating an “a:” dictionary involves quite a lot of overhead. In a Vim9 function this dictionary is not available. Other differences are more subtle, such as how errors are handled.

So, you no longer get 100% backwards compatibility, but the legacy scripts should work as usual.

In addition to the performance improvements, the new script language also aims to get closer to commonly used programming languages, including JavaScript, TypeScript, and Java.

The developers also plan to add support for classes in the script language.

You can learn more about the new script in the official help page.

New Features

You will also find some technical feature additions like:

  • Function must be defined with def, if you want to benefit from the speedup.
  • The arguments and return types must be specificed.
  • Line continuation does not require using a backlash.
  • It now simpler to split large scripts. You can use export to make functions/variables available to other scripts, and import to use exported items.
  • Comments now start with # replacing double quote syntax.

In either case, you can always refer to the official announcement to explore all the technical details with the update.

Download Vim 9.0

If you are going to try Vim for the first, you might want to check out our Vim vs Nano comparison article (keeping in mind the changes for this release).

You can download the latest version directly from the official website. Packages should be available for Debian-based/Ubuntu-based systems. For other Linux distributions, you might want to explore the documentations.

You can build it from sources and apply the latest patches as well.


via: https://news.itsfoss.com/vim-9-0-release/

作者:Ankush Das 选题:lkxed 译者:译者ID 校对:校对者ID

本文由 LCTT 原创编译,Linux中国 荣誉推出