当前位置:网站首页>VIM 9.0 is officially released! The execution speed of the new script can be increased by up to 100 times
VIM 9.0 is officially released! The execution speed of the new script can be increased by up to 100 times
2022-07-03 01:33:00 【The way of Python data】
Produce | OSC The open source community (ID:oschina2013)
take Vim 9.0 Version dedicated to Sven Guckes, He is in 2022 year 2 The month passed away .Sven yes Vim Core maintainer of , He registered vim.org Domain name and created the first Vim Website , We will commemorate him with this .
After years of gradual improvement ,Vim Now there is an important version , A big step forward . In addition to many small additions and improvements , The focus of this release is Vim A new change in scripting language :Vim9 Script.
The last version was 2019 year 12 Released on 8.2 edition . Because the latest source code will always be in GitHub The provision of , Therefore, many users have already installed the later patch version ( There are more than 5000 individual ), These changes have been tried by many users . stay 8.2 On the basis of , Many errors have been fixed 、 The security problem has been solved , Code coverage has been greatly improved . This version is more reliable than any previous version .
Vim9 Script
Vim The script for has evolved over time , While preserving backward compatibility . This means that the wrong choices of the past often cannot be changed , And Vi Compatibility also limits possible solutions . So the execution speed is quite slow , Each row should be parsed at each execution .
Vim9 Script The main goal of is to dramatically improve performance . This is achieved by compiling commands into instructions that can be effectively executed , The speed of implementation is expected to increase 10 To 100 times .
Vim9 Script Our secondary goal is to avoid Vim Unique structure , Make it closer to common programming languages , Such as JavaScript、TypeScript and Java.
Performance can only be improved by not 100% Backward compatibility . for example , By creating a "a:" Dictionaries make function parameters available with considerable overhead , stay Vim9 Function , This dictionary is no longer available .
For developers who have a lot of traditional scripts, don't worry too much , These scripts can still be used as before . There are currently no plans to abandon support for traditional scripts , Change will not be like Python 2 To Python 3 So violent .
Interesting features
To benefit from acceleration , A function must use def
To define , Parameters and return types must be specified . This is not just to make execution faster , It also helps to detect errors early when functions are compiled into bytecode . Variables need to use var
To declare the , And there is also a type , It can be specific , It can also be inferred from the assigned value .
The continuation of a line does not require the use of backslashes , This is the mechanism used in traditional scripts .
Function calls do not require call
, Assignment does not require let
, The expression does not need to be evaluated eval
. This makes Vim9 Script Looks more like most programming languages .
Breaking up a large script into smaller pieces is now much easier . In a script , export
Used to make specific functions and variables available to other scripts , Then use... Where you need to use the exported project import
. Combined with automatic loading mechanism , This provides a flexible and powerful way to implement large plug-ins .
Now comment with #
start . The old double quotation mark grammar came from the old Vi, Will interfere with the use of strings . In many other languages , for example Python and shell Script , We all know #
The meaning of .
Future work
stay Vim9 Script One of my plans is to add classes , Although you can use a dictionary to simulate , But this is far from ideal . Most programmers are familiar with classes , stay Vim9 Script Such things should also be added to , Currently the keyword has been reserved .
More details can be found at :https://www.vim.org/vim90.php
边栏推荐
- 【数据挖掘】任务6:DBSCAN聚类
- Soft exam information system project manager_ Real topic over the years_ Wrong question set in the second half of 2019_ Morning comprehensive knowledge question - Senior Information System Project Man
- 【我的OpenGL学习进阶之旅】关于欧拉角、旋转顺序、旋转矩阵、四元数等知识的整理
- 不登陆或者登录解决oracle数据库账号被锁定。
- Niu Ke swipes questions and clocks in
- MySQL foundation 07-dcl
- Create your first Kivy program Hello word (tutorial includes source code)
- openresty 缓存
- 【FH-GFSK】FH-GFSK信号分析与盲解调研究
- Leetcode 6103 - minimum fraction to delete an edge from the tree
猜你喜欢
QTableWidget懒加载剩内存,不卡!
Androd gradle's substitution of its use module dependency
Basic concept and implementation of overcoming hash
leetcode 6103 — 从树中删除边的最小分数
[C language] detailed explanation of pointer and array written test questions
Basic remote connection tool xshell
MySQL --- 数据库查询 - 基本查询
力扣 204. 计数质数
MySQL foundation 04 MySQL architecture
Detailed explanation of Q-learning examples of reinforcement learning
随机推荐
MySQL foundation 04 MySQL architecture
Telecom Customer Churn Prediction challenge
Machine learning terminology
MySQL - database query - basic query
Test shift right: Elk practice of online quality monitoring
Using tensorboard to visualize the model, data and training process
【FH-GFSK】FH-GFSK信号分析与盲解调研究
What are the trading forms of spot gold and what are the profitable advantages?
The difference between tail -f, tail -f and tail
Kivy tutorial how to create drop-down lists in Kivy
Force buckle 204 Count prime
Meituan dynamic thread pool practice ideas, open source
Installation and use of serial port packet capturing / cutting tool
Basic remote connection tool xshell
Database SQL language 02 connection query
Wireshark data analysis and forensics a.pacapng
Database SQL language 01 where condition
2022 Jiangxi Provincial Safety Officer B certificate reexamination examination and Jiangxi Provincial Safety Officer B certificate simulation examination question bank
MySQL basics 03 introduction to MySQL types
Top ten regular spot trading platforms 2022