103 points · by elvis70 · 4y ago · 118 comments
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-differencesAnd 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 :)
I’ve been using neovim for a while now but just switched my config over to Lua yesterday. I’ve never seen a line of Lua before yesterday but I _already_ find it way easier to write than vimscript—which I’ve been writing since the early 2000s.
Seems this has been said about every single language ever (except the first I guess?), even languages as Golang and Rust have gone through a phase where many question "why even build a new language when X does Y and Z perfectly fine already?", and then they end up really popular anyways as they solved some slice of problem(s) is a particular way that many like.
And golang initially started off as a replacement for C, and then pivoted because they couldn't achieve that purpose ... now, it's touted for simplicity. When Rust was a pet project of Graydon, it looked VERY different to what it is right now. My point is that vim9script as it stands right now doesn't solve any real world use case that lua wouldn't be better suited for. Maybe vim9script will be better for something else entirely in the future, and that will be, as you describe something people may like. But right now we don't even know what that is, and surely that can't be a reason to decide to go explore language design in such a large community such as the one vim has? It is definitely Bram's right to do so, but I fear that people will rather move to neovim or vscode or emacs than learn and write vim9script, and as a user of that community I think that would be bad.
Also, it's not like people were proclaiming vimscript was awesome you know. There's a talk from one of the core devs of vim-lsp on YouTube [1], on features of vimscript, and literally in every slide the presenter caveats the vimscript feature in one way or another. I find it hilarious, it's a perfect example of the frustration of when writing plugins with vimscript.
I have a dear place in my heart for tiny focused languages and think if Vim had stated they were going to suddenly make Wren, Gravity, Janet, etc first class languages, there would be less reluctance than a new thing.
Very, very rarely, lots of people find reasons use a language designed by (such) an idiot, anyway. We are lucky when the language is not terrible, because how good it is even more rarely affects whether it will take off.
In practice, languages almost always ride to popularity on the back of something else. C rode Unix, C++ rode C, Java rode Sun Microsystems' $billions and the promise of getting off Microsoft's framework-hell treadmill, C# rode .Net, Javascript rode HTML (and then web services because the same people were coding both, at first), Go rode Google and Docker. Lua got where it is by being really easy to embed, and being simple, powerful, not weird, and (lately) fast.
Python got there mostly the hard way, but also by being easy to embed and to extend with C ABI-compatible plugins, despite being weird and extra-super-slow.
Amazon, BTW, might be unique among IT behemoths in not hustling its own walled-garden language. (Or maybe I just don't know about it.)
1 - https://groups.google.com/g/vim_dev/c/__gARXMigYE/m/iskHVwgU...
On other trends (Google Trends to be specific), search volume for Lua only became larger than for Vim in 2004, with Lua hitting it's peak in 2009. Search volume for Vim would have been much larger before 2004 if we had a single search engine everyone could have used, but hard to know in afterhand I guess.
I don't think that vimscript is that bad. What i don't like about are the scope rules, i.e. special prefixes for function arguments, locals and globals. Also the call keyword is required for function calls and let keyword for assignments.
Anyway, Python can be used as a vim extension language, i am not sure if Lua is superior in this respect to python.
(Can we stop hijacking Vim threads? Submit a FPP about neovim.)
I don't love lua, but moving to a "standard" scripting language has a lot of value.
And neovim proves that lua is viable, so...
Every Vim discussion has neovim people finding ways to attack Vim. The signal is always negative which makes the signal meaningless - the source is just tuned to transmit negative.
It's a major reason I don't consider neovim. Who wants to be involved in that community, defined it seems by hating someone else's hard work - which they are giving to the public for free - and being parasites on the other's reputation. Just do your own thing, in your own way, and do something wonderful - don't worry about criticizing others. Ugh.
You can start experimenting with Lua and the new plugins whenever you're able to.
I tried out NeoVim, but as far as I can tell, it seems to be terminal-only/keyboard-only? I can use Vim keyboard-only (certainly I do that all the time over ssh), but it's not my preference.
My second choice for editing behind MacVim isn't NeoVim but VSCode, but I don't use VSCode with Vim bindings because in my experience grafting Vim bindings onto any editor not Vim won't be feature complete. In a perfect world, there would be an IDE which is truly a Vim-style modal editor at its core.
"Graphical interfaces are not packaged with Neovim. GUIs are not limited by terminal capabilities and can choose to override the rendering of certain neovim elements (cursor, tabline, popup menu, etc)...See Neovim's wiki[1] for a list of many of the available GUIs."
[1] https://github.com/neovim/neovim/wiki/Related-projects#gui
Why? Because there’s not a _single_ neovim client that is as good as MacVim.app. I paid for Oni2 (I regret that; it’s _not_ a vim replacement). I have contributed code and time to helping a couple of other GUIs fix their issues. But they are all crap compared to MacVim.app.
Until that is fixed, I don’t think that there’s a good reason to consider switching.
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.
> 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.
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?
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. 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.
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.
It's not as popular as vim per say, but it's definitely catching up. It's kinda silly to suggest otherwise.
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.
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.
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.
Their twitch streams where they work on this are a lot of fun too.
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.
> 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.
:e https://raw.githubusercontent.com/vim/vim/master/runtime/doc...