[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Adding c/c++ scripting
From: |
Xue Fuqiao |
Subject: |
Re: Adding c/c++ scripting |
Date: |
Mon, 25 Jan 2016 16:46:58 +0800 |
On Sun, Jan 24, 2016 at 1:35 PM, Tom <address@hidden> wrote:
> Xue Fuqiao <xfq.free <at> gmail.com> writes:
>>
>> PS: Personally, I like Neovim's plugin architecture. With the msgpack
>> API, you can even use C#/Ruby/JavaScript/... to write plugins.
>
> Does it support calling, for example, a function defined in a C#
> plugin from a Javascript plugin?
No.
> Because that is the important thing that you could write a plugin in
> any language and use the resulting code from any other language.
>
> If it's not possible then these plugins are just isolated pieces
> of code which is much less useful.
Quoting Justin (a Neovim developer)[1]:
The msgpack API is equivalent to a REST/HTTP API that allows you to
call other "services" (plugins) which are listening behind that
API. Everything gets marshaled through msgpack. To make a C# function
callable by a javascript plugin, the C# plugin would need to listen
for an event.
And there is certainly no "binding" of live objects
any plugin can of course map VimL functions to its language-of-choice
(C#, javascript, ...) functions, and those VimL functions can be
called by other functions
I don't agree that "the important part" is having a magic FFI that
bridges all languages. And I do think that isolation is good.
[1] https://gitter.im/neovim/neovim?at=56a594cf586242210adf4ed9