Having to re-compile Vim with support for a language is one of its bigger
drawbacks. It's fine for a common language like Python, but the more obscure it
gets, the less likely it is that your plugin will be of any use to other
people. You should take a look at Neovim:
https://neovim.io/Neovim is a fork of Vim which aims to bring the code up to modern standards. It
is not a rewrite, so all existing plugins should work and the Neovim developers
keep up with new Vim patches.
One of the innovations in Neovim is its remote API. In Vim you have to compile
Vim with support for a foreign language, but in Neovim that support can be
retrofitted to the editor as an external process. So for example, if you want
to write Neovim plugins in Python you install the Python client via pip. And if
you want to write plugins in Racket you install my Racket client:
https://gitlab.com/HiPhish/neovim.rktYou could then write an "evaluator" plugin in Racket like this:
#lang racket
;; Save in a file like '~/.config/nvim/rplugin/racket/eval.rkt'
(require nvim)
(nvim-function "RacketEval"
(λ (args)
(define str (vector-ref args 0))
(call-with-input-string str (λ (in) (eval (read in))))))
This won't actually work with an argument like "(+ 2 3)", Racket complains that
the '+ is an undefined identifier, but that's a problem on the Racket side (I
don't know that much about Racket yet to be able to do eval magic), not on the
editor side. The RacketEval function is like any other Neovim function, except
that it offloads the work to an external process behind the scene, but the user
never notices that.
The Racket client is still under development, I have not yet committed fully to
the public interface and I need to take care of some edge cases when something
goes wrong. Other than that, the client fully works.
On Sunday, December 17, 2017 at 2:33:26 PM UTC+1,
gokceh...@gmail.com wrote:
...