mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-01 21:50:13 +08:00
90 lines
4.0 KiB
Markdown
90 lines
4.0 KiB
Markdown
[#]: subject: "Vim 9.0 is Here With a New Script Language Promising Performance Boost"
|
||
[#]: via: "https://news.itsfoss.com/vim-9-0-release/"
|
||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||
[#]: collector: "lkxed"
|
||
[#]: translator: " "
|
||
[#]: reviewer: " "
|
||
[#]: publisher: " "
|
||
[#]: url: " "
|
||
|
||
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.
|
||
|
||
![][1]
|
||
|
||
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: What’s 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, isn’t it?
|
||
|
||
However, what’s the catch for these performance improvements? Here’s 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][2].
|
||
|
||
#### 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][3] 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][4] (keeping in mind the changes for this release).
|
||
|
||
You can download the latest version directly from the [official website][5]. 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][a]
|
||
选题:[lkxed][b]
|
||
译者:[译者ID](https://github.com/译者ID)
|
||
校对:[校对者ID](https://github.com/校对者ID)
|
||
|
||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||
|
||
[a]: https://news.itsfoss.com/author/ankush/
|
||
[b]: https://github.com/lkxed
|
||
[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/vim-9.0.jpg
|
||
[2]: https://vimhelp.org/vim9.txt.html
|
||
[3]: https://www.vim.org/vim90.php
|
||
[4]: https://itsfoss.com/vim-vs-nano/
|
||
[5]: https://www.vim.org/download.php
|