14 ms·
Vim9 Script Feature-Complete
- totorovirus 5y agovim is cool but it's simply not worth investing time to learn a language that only works for one specific editor.
- lawn 5y agoThis is a perfect example of NIH (Not Invented Here). So you have the huge success of first-class Lua support in Neovim, and it's clear that there is a very real need for a better scripting language in Vim. But not only do you skip Lua, and lose out on the work and plugins that has already been done, you decide to write yet another custom scripting language.
- deleted 5y ago[deleted]
- wolverine876 5y agoHow do we meaure 'huge success'? The only place I hear about Neovim is on HN, where people hijack Vim threads with it.
- drekipus 5y agoNot to join in the lynching, but nvim is stable and healthy in terms of development velocity. It's not as popular as vim per say, but it's definitely catching up. It's kinda silly to suggest otherwise.
- wolverine876 5y agoThey said "huge success". Huge successes in text editors are Vim, Emacs and maybe Sublime. And do you have anything to backup your claims about neovim's popularity?
- deleted 5y ago[deleted]
- L0stLink 5y agoOne measure is the number of stars on github and active contributors 49.7k vs 25.7k and 737 vs 79. The other measure can be the number of new extensions being written for each of them (particularly extremely high quality ones like telescope). Searching `nvim` on github yields many plugins which are advertising the Neovim editor by having it in their name, some of these are even ones which support vim e.g. Shougo/denite.nvim all of which point to the fact that neovim is a huge success and is on tract to overtake vim. It would not be an exaggeration to say that a lot if this is due to first class lua support in Neovim. By adding nice features like treesitter and LSP it has become an improved version of vim, an editor that actually understands the code being edited beyond simple text objects (e.g. https://youtu.be/E4uaPs9e9UU?t=68 https://youtu.be/E4uaPs9e9UU?t=68)
- leadingthenet 5y agoAccording to the latest Stack Overflow developer survey, neovim is used by almost as many people as Emacs is[1]. By your own definition, Emacs is a “huge success”, therefore I’d expect you to extend that description to nvim, too. [1]: https://insights.stackoverflow.com/survey/2021#section-most-popular-technologies-integrated-development-environment https://insights.stackoverflow.com/survey/2021#section-most-...
- svlasov 5y agoI wish instead of `endfun`, `endif`, `endfor`, `endwhile`, etc. Vim9Script would have gone with a more unified syntax like curly braces.
- ezekiel68 5y agoThis looks great. Some takeaways from looking into the documentation: They're promising 10x - 100x better performance (since vim9script is typed and will be compiled). Also -- you can mix vimscript and vim9script in a function, a file, or a module. This will let legacy modules or scripts stay mostly the same but port some of the slower-running bits to vim9script to gain the benefits without a giant effort to port the whole thing.
- Tyr42 5y agoAh, that's the key part people are missing above, you can opt in on a function by function level.
- blindseer 5y agoI think it’s kind of crazy that vim9script is even a thing, especially when neovim has proven how much more viable lua is as a scripting language. Lua is way more beginner friendly than vimscript or vim9script, with luajit you get killer performance, lua has an awesome language server implementation, it’s a saner programming language imo and so much more going for it. There’s even transpilers to convert typescript / other languages to lua. There’s plugins written in lua today that just wouldn’t be possible in vimscript or vim9script script. Vim9script on the other hand seems like an exploration in PL, which I’m all for generally but not in a software like vim. Like, just imagine writing and maintaining something like magit or org mode in vim9script. It’s a large complicated piece of software, you'll have to write it using without any linter, formatter or language server (at least for the foreseeable future) and your skills are not transferable to any other tool. Just the sheer probability of better plugins existing and thriving in your ecosystem drop significantly once you choose to have vim9script as the scripting language. I’m curious to see how this all pans out but I’m not optimistic. The worst part is that it doesn't appear that existing plugins will work in vim9script. Even the syntax for commenting is different: set number " This is a comment in vimscript set number # This is a comment in vim9script See https://vimhelp.org/vim9.txt.html#vim9-differences https://vimhelp.org/vim9.txt.html#vim9-differences And to get any performance improvement, plugin authors will have to do a LOT of work that is not compatible with their existing plugins. I for one am glad neovim exists, and I encourage people to throw a few bucks their way :) https://github.com/sponsors/neovim https://github.com/sponsors/neovim
- gtsop 5y agoI've avoided neovim because my current vim setup justworks™ and i trully depend on it for being productive on my job. As time goes by i really feel like i should switch based on how the two projects progress. Do you know of a resource that could hold my hand?
- rmadriz 5y agoWell in theory everything that works in vim will work in neovim (there's a few exceptions[^1]). So you really don't loose anything by installing neovim and using your same .vimrc for it. You can start experimenting with Lua and the new plugins whenever you're able to. [1]: https://github.com/neovim/neovim/issues/1716 https://github.com/neovim/neovim/issues/1716
- Daedren 5y agoInterested to see how this will impact the plugin community, as the Neovim maintainer mentioned he wouldn't implement vim9script there.
- capableweb 5y agoMore or less furthering the gap we all knew was coming at one point or another (opinion from former Vim user but current Neovim user). Neovim ecosystem mostly write plugins in Lua by now, and most new Vim plugins will probably require something from Vim9 Script at one point.
- neurobashing 5y agoIf I had to guess: someone will eventually build a transpiler/converter of some sort, most likely vim9->Lua (assuming my guess that vim still has more users than Neovim).
- blindseer 5y agoTJ (one of neovim's core devs) has already started work on that: https://github.com/tjdevries/vim9jit https://github.com/tjdevries/vim9jit Their twitch streams where they work on this are a lot of fun too.
- turminal 5y agoI feel like vim should really be focusing on other, less shiny things. Users that primarily want a shiny editor are already using VS code and the like.
- the_duke 5y agoThere is an overview here: https://vimhelp.org/vim9.txt.html https://vimhelp.org/vim9.txt.html I do question if a breaking change for a custom language is the right way to go. Built in Lua support in Neovim (with LuaJIT) has done wonders for the plugin ecosystem. There is a lot of activity, and a lot of pluings with great quality have quickly replaced older ones. That's no surprise. LuaJIT is fast, much easier to write, has a has a sizeable ecosystem and a good LSP server. Even an overhauled Vimscript won't be anything more than a odd niche language with worse performance. I would have loved for Vim to also adopt Lua and the Lua API from Neovim to prevent a complete ecosystem split. I just don't see how implementing a new language makes sense in this context, except for fun.
- coliveira 5y agoThis is not a breaking change. Everything that works on Vim8 script will continue to work. The new scripting language will provide extensions that you can use to get better speed. > I would have loved for Vim to also adopt Lua Vim has supported Lua for a long time. Anyone who wants to really use Lua for Vim plugins already has the option of doing so.
- capableweb 5y ago> Vim has supported Lua for a long time. Anyone who wants to really use Lua for Vim plugins already has the option of doing so. How does that compare to writing Lua plugins for Neovim? Seemingly all search results for "write vim plugin in lua" are dominated by results for writing lua plugins for neovim. Does vanilla Vim have something like Neovim's "Remote Plugin" or how does it work?
- blindseer 5y agoMy understanding is that neovim devs would like to see a lua interface in vim, but right now there's a lot of functions in neovim's lua interface that are not available in vim's lua interface. But for the stuff that is available, you can either use the vim help to learn about it or search on vim's github issues / PRs, e.g. https://github.com/vim/vim/pull/7959 https://github.com/vim/vim/pull/7959. I'm curious if there are other ways to learn more about vim's lua interface, searching on google as you said does not give great results for vim, just neovim.
- davidgrenier 5y agoSo I just did this command for the hell of it, and it worked: :e https://raw.githubusercontent.com/vim/vim/master/runtime/doc/vim9.txt https://raw.githubusercontent.com/vim/vim/master/runtime/doc...
- coliveira 5y agoThis is great news. I think Vim9Script is an excellent language. Just the fact that it will help speedup existing scripts is going to been a boom for Vim usage and plugin development.
- petre 5y agoSo is Lua or Guile. No need for a new extension language with bashisms and Java and JS inspired stuff.
- blindseer 5y agoI don't believe it'll speed up existing plugins though. If I remember correctly, vim9script is akin to an entire new programming language. Heck, even the syntax for comments has changed. set number " This is a comment in vimscript set number # This is a comment in vim9script There's going to be a LOT of porting of existing plugins for this to all work.
- capableweb 5y agoYour comment seems to be at direct odds with https://news.ycombinator.com/item?id=29759980 https://news.ycombinator.com/item?id=29759980 > This is not a breaking change. Everything that works on Vim8 script will continue to work. So seems it won't require much porting unless people want to do the porting.
- blindseer 5y agoYou are right, my apologies. Reading through this https://vimhelp.org/vim9.txt.html https://vimhelp.org/vim9.txt.html again, it appears that you can intermix vimscript and vim9script.
- gbrown_ 5y agoI should start by saying my Vim config is reasonably minimal, but I'm highly skeptical of this making plugins noticeably faster. How much time are plugins spending executing Vimscript vs executing external tools?
- co_dh 5y agoI still prefer kakoune, and using sh as scripting language for it's simplicity.
- diegocg 5y agoKakoune is vi done right. I'm surprised it isn't used more often
- drekipus 5y agoI would love to change but neovin is just too useful for me.
- cassepipe 5y agoThere's a Kakoune like text editor written in Rust that is not 1.0 that should worth looking into. It's called Helix https://helix-editor.com/ https://helix-editor.com/
- wizardofmysore 5y agoThis seems like a too smart for your own good situation. Just because you can write a programming / scripting language doesn't mean you should. There are tons being developed already, why not just adopt one of those. I support NeoVims decision of going the lua route.
- wolverine876 5y ago> help me help AIDS victims -- http://ICCF-Holland.org http://ICCF-Holland.org What happened to the orphanage in Uganda? Not a criticism, just curious about the change. It's fantastic that Bram uses Vim's platform to lead and encourage others to support those in need.
- ncmncm 5y agoAIDS is also a huge problem throughout Africa.
- wolverine876 5y agoLike I said, I think it's great and important that he's doing it. I'm just wondering what happened to the orphanage.
- wolverine876 5y agoI don't write much in Vim script, but what are the implications for my beloved, carefully tended .vimrc file?