当前位置:网站首页>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
边栏推荐
- Daily topic: movement of haystack
- Type expansion of non ts/js file modules
- tail -f 、tail -F、tailf的区别
- 强化学习 Q-learning 实例详解
- Makefile中wildcard、patsubst、notdir的含义
- Learn the five skills you need to master in cloud computing application development
- uniapp组件-uni-notice-bar通告栏
- Leetcode 2097 - Legal rearrangement of pairs
- 【数据挖掘】任务6:DBSCAN聚类
- [机缘参悟-36]:鬼谷子-飞箝篇 - 面对捧杀与诱饵的防范之道
猜你喜欢

一比特苦逼程序員的找工作經曆

leetcode刷题_两数之和 II - 输入有序数组

leetcode 6103 — 从树中删除边的最小分数

MySQL --- 数据库查询 - 条件查询

并发编程的三大核心问题 -《深入理解高并发编程》

Niu Ke swipes questions and clocks in

Why is it not recommended to use BeanUtils in production?

【FPGA教程案例6】基于vivado核的双口RAM设计与实现

音程的知识的总结

C application interface development foundation - form control (3) - file control
随机推荐
海量数据冷热分离方案与实践
音程的知识的总结
【系统分析师之路】第五章 复盘软件工程(开发模型开发方法)
2022 coal mine gas drainage examination question bank and coal mine gas drainage examination questions and analysis
Leetcode 6103 - minimum fraction to delete an edge from the tree
C application interface development foundation - form control (4) - selection control
Database SQL language 01 where condition
MySQL foundation 06 DDL
Key wizard play strange learning - front desk and Intranet send background verification code
MySQL foundation 05 DML language
Canvas drawing -- bingdd
[system analyst's road] Chapter V double disk software engineering (development model development method)
一位苦逼程序员的找工作经历
[技术发展-23]:DSP在未来融合网络中的应用
[自我管理]时间、精力与习惯管理
Meibeer company is called "Manhattan Project", and its product name is related to the atomic bomb, which has caused dissatisfaction among Japanese netizens
tail -f 、tail -F、tailf的区别
What is tone. Diao's story
[androd] module dependency replacement of gradle's usage skills
QTableWidget懒加载剩内存,不卡!