neovim/neovim — pull request #1252 by tarruda (2014-09-27 14:28:51+00:00)
Title: [WIP/RFC] Add Function type to the API

Goals of this PR:

- Finish decoupling the API from msgpack-rpc. By making functions like `vim_register_provider` and `vim_subscribe`/`vim_unsubscribe` receive Function instances, we can make the API usable by non-msgpack plugins(by libraries loaded dynamically via `libcall()` for example). Translating Function instances to remove msgpack-rpc calls will be fully handled by the msgpack-rpc layer.
- Let plugins(written in any language) to transparently pass functions to/from vimscript.

For example, a python plugin may be able to do things like:

```python
def python_execute()
pass

def python_eval()
pass

vim.register_provider('python', {
'execute': python_execute
'eval': python_eval
})

# or even

vim.vars['PythonEval'] = python_eval
# g:PythonEval is now callable from vimscript
```

Clearly this will require some support on the client, which I'm still going to implement.