An std-lib for Vim9script

42 views
Skip to first unread message

Igbanam Ogbuluijah

unread,
Dec 12, 2024, 4:04:43 AM (11 days ago) Dec 12
to vim...@googlegroups.com
Hi everyone,

What do we think about getting a standard library (std-lib) of sorts for vim9script?

While using Vim9script for Advent of Code this year — definitely not the reason vim9script was created for, but — I realized some interesting library additions like :h libreactive, :h libtinytest; there are more. I think these are fantastic.

Would Vim9script be looking to expand these into a formal std-lib? Also, if I wanted to contribute a library to Vim9script, where in the codebase should I be looking into?

Thanks!


Igbanam

Yegappan Lakshmanan

unread,
Dec 12, 2024, 10:51:39 AM (10 days ago) Dec 12
to vim...@googlegroups.com
Hi,

These scripts can be placed under the runtime/pack/dist/opt/stdlib/autoload directory and can be imported by plugins.

Regards,
Yegappan

Christian Brabandt

unread,
Dec 13, 2024, 11:30:43 AM (9 days ago) Dec 13
to vim...@googlegroups.com

On Thu, 12 Dec 2024, Yegappan Lakshmanan wrote:

> Would Vim9script be looking to expand these into a formal std-lib?
> Also, if I wanted to contribute a library to Vim9script, where in
> the codebase should I be looking into?
>
> These scripts can be placed under
> the runtime/pack/dist/opt/stdlib/autoload directory and can be
> imported by plugins.

We could also use runtime/autoload/dist/vim.vim because it is already
used.

Thanks,
Christian
--
Sentient plasmoids are a gas.

Lifepillar

unread,
Dec 13, 2024, 4:54:18 PM (9 days ago) Dec 13
to vim...@googlegroups.com
>> Would Vim9script be looking to expand these into a formal std-lib?

I've created the vim-devel package, which the scripts you mention are
part of, partly to become more proficient with Vim 9 script and partly
to create and collect some reusable components for my scripts. I'd like
to make it clear that at the moment that repo is a personal initiative,
and mostly experimental in nature (although I am actively using those
libraries, and I'm open to collaboration on that repo).

Let's see how much traction your proposal gets. In any case, several key
questions need to be answered, in primis: what can improve the
programming ux enough for enough people to justify putting it into
a "standard library"?

Life.

Igbanam Ogbuluijah

unread,
Dec 13, 2024, 10:26:01 PM (9 days ago) Dec 13
to vim...@googlegroups.com
That explains why I couldn't find it anywhere in the Vim repo. 

First off… thank you for creating those. I think they would be find contributions to Vimscript as a language. I know these are mainly in their alpha stages today, but if there are any discussions concerning why this should be added to Vimscript somewhere, please let me know. I'd be happy to chime in.


Igbanam


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/vjiadn%24jtd%241%40ciao.gmane.io.

Steve Litt

unread,
Dec 14, 2024, 5:20:01 PM (8 days ago) Dec 14
to vim...@googlegroups.com
Igbanam Ogbuluijah said on Thu, 12 Dec 2024 09:04:14 +0000

>Hi everyone,
>
>What do we think about getting a standard library (std-lib) of sorts
>for vim9script?

In every language, I'm a big fan of *well curated, language community
supported* standard libraries. If it's well thought out, easy to use,
easy to document, and mostly bug free, I like the idea.

>Would Vim9script be looking to expand these into a formal std-lib?
>Also, if I wanted to contribute a library to Vim9script, where in the
>codebase should I be looking into?

It's *very* important that any standard library be well curated. This
means not everything goes in the standard library, just stuff that
works, works well, makes programming easier, and is relatively bug
free. Therefore I think the standard library should most likely be a
subset of the library additions.

In summary, if you make it easier for me to learn and use Vim9script,
I'm a huge fan. I might even rewrite VimOutliner in Vim9script, because
truth be told, the old Vimscript was, in my opinion, horrible.

SteveT

Steve Litt

http://444domains.com
Reply all
Reply to author
Forward
0 new messages