Repo for nvim plugins in "ocaml/neovim, vcaml "?

There is this really cool project: GitHub - janestreet/vcaml: OCaml bindings for the Neovim API which allows writing nvim plugins in OCaml.

Question: is there a repo these plugins? I.e. a repo for creating nvim plugins in OCaml.

4 Likes

I’m not sure what you’re imagining for a repo for creating Neovim plugins. VCaml can be used to create a plugin, and that project can be made available in a Github repo. Note that unlike VimL or Lua plugins, which are interpreted by Neovim, plugins built with VCaml are remote plugins (separate binaries), which means that you will need to either distribute the binary or have a step for package managers to build the binary on plugin installation (something analogous to this). Also note that because VCaml uses Async, the plugins will only work on Unix platforms. One last caveat is that the latest released version of VCaml is only compatible with Neovim 0.7.0. We are aiming to release a version compatible with 0.9.0 in the not-too-distant future.

I’m looking for list of github repos that use VCaml to write async-remote neovim plugins in OCaml.

To the best of my current knowledge, this list is currently empty – i.e. if people are using VCaml to build neovim plugins, they are not publishing them to github.

Yes, that doesn’t surprise me. VCaml hasn’t seen wide adoption yet, in part because it’s historically lagged Neovim versions and in part because the currently released version is not very ergonomic. We are working on improving considerably on both fronts.

Probably a stupid question, but is compiling OCaml to lua even remotely
doable? It seems like many people write neovim plugins in lua these
days, so it could help with interop…

I finally gave up on that.
However, I found Haxe, which is a language heavily influenced by Ocaml, and I am maintaining my own library for writing Neovim plugins in Haxe. While Haxe is primarry OOP, it can handle FP idioms pretty well. You can have a look here: GitHub - danielo515/haxe-nvim: Configure NeoVim in Haxe!!! Lua externs for the neovim lua API
The repo has some links to example plugins and example configs using Haxe