What’s New in Vim 9.0? Exploring the Fast, Modern Vim9 Script
Vim 9.0, dedicated to the late maintainer Sven Guckes, introduces Vim9 Script—a compiled, high‑performance scripting language that boosts execution speed up to 100×, modernizes syntax, retains compatibility with traditional scripts, and adds features like export/import and # comments while planning future class support.
Vim 9.0 is dedicated to Sven Guckes, a core maintainer who passed away in February 2022.
After years of incremental improvements, Vim 9.0 introduces a major change: the new Vim9 Script language, alongside many bug fixes and security patches that make this version more reliable than any previous release.
Vim9 Script
Vim’s script language has evolved while preserving backward compatibility, which limited performance. Vim9 Script aims to dramatically increase speed by compiling commands into efficient bytecode, promising 10‑100× faster execution.
The secondary goal is to make the syntax resemble common programming languages such as JavaScript, TypeScript, and Java, moving away from Vim‑specific constructs.
Performance gains require sacrificing full backward compatibility; for example, the “a:” dictionary used for function arguments is no longer available in Vim9 functions.
Existing traditional scripts continue to work, and there are no plans to drop support, so the transition is not as disruptive as Python 2 → 3.
Interesting Features
To benefit from acceleration, a function must be defined with def and specify parameter and return types. Variables are declared with var, optionally with an explicit type or inferred from the assigned value.
Line continuations no longer need a backslash, function calls omit the call keyword, assignments drop let, and expression evaluation does not require eval, making Vim9 Script look like most mainstream languages.
Large scripts can be split using export to expose functions or variables and import to use them elsewhere, enabling flexible plugin development.
Comments now start with #, replacing the old double‑quote syntax that conflicted with strings.
Future Work
One planned feature is adding class support; although dictionaries can simulate classes, a proper class keyword is reserved for future implementation.
More details are available at https://www.vim.org/vim90.php.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
