当前位置:网站首页>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
- [Androd] Gradle 使用技巧之模块依赖替换
- 【第29天】给定一个整数,请你求出它的因子数
- openresty 缓存
- Using tensorboard to visualize the model, data and training process
- leetcode 6103 — 从树中删除边的最小分数
- Installation and use of serial port packet capturing / cutting tool
- Concise analysis of redis source code 11 - Main IO threads and redis 6.0 multi IO threads
- [FPGA tutorial case 5] ROM design and Implementation Based on vivado core
- How wide does the dual inline for bread board need?
猜你喜欢

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

How wide does the dual inline for bread board need?

Androd gradle's substitution of its use module dependency

Machine learning terminology

Using tensorboard to visualize the model, data and training process

【面试题】1369- 什么时候不能使用箭头函数?

Main features of transport layer TCP and TCP connection

音程的知识的总结

What is tone. Diao's story
![[FPGA tutorial case 6] design and implementation of dual port RAM based on vivado core](/img/fb/c371ffaa9614c6f2fd581ba89eb2ab.png)
[FPGA tutorial case 6] design and implementation of dual port RAM based on vivado core
随机推荐
C语言课程信息管理系统
力扣 204. 计数质数
Arduino dy-sv17f automatic voice broadcast
[FPGA tutorial case 5] ROM design and Implementation Based on vivado core
Main features of transport layer TCP and TCP connection
MySQL foundation 06 DDL
After reading this article, I will teach you to play with the penetration test target vulnhub - drivetingblues-9
Database SQL language 02 connection query
串口抓包/截断工具的安装及使用详解
Button wizard play strange learning - go back to the city to buy medicine and add blood
[principles of multithreading and high concurrency: 2. Solutions to cache consistency]
GDB 在嵌入式中的相关概念
Mathematical Knowledge: Steps - Nim Games - Game Theory
一位苦逼程序员的找工作经历
【C语言】指针与数组笔试题详解
Concise analysis of redis source code 11 - Main IO threads and redis 6.0 multi IO threads
如今少年已归来,人间烟火气最抚凡人心 复工了~
Basic concept and implementation of overcoming hash
The industrial scope of industrial Internet is large enough. The era of consumer Internet is only a limited existence in the Internet industry
Kivy教程大全之 创建您的第一个kivy程序 hello word(教程含源码)