On 9/15/2011 12:19 PM, Marc Weber wrote:
Excerpts from Kerneels Roos's message of Thu Sep 15 12:00:18 +0200 2011:
Looks like my gvim on win32, the standard distro doesn't have if_scheme
compiled in. Looking at ":he if_py", which I suppose the if_scheme
support is similar to, it looks like you can get vim to exec language X
(python code with respect to if_py) from inside vim scripts is that
right? Never done that before.
No, if_py will segfault if you try to call back into vim from a python
thread. It works fine if you don't. See vim-addon-background-cmd which
uses client-server for that reason to call back into Vim for exactly
that reason.
I've spend several minutes reading the C code.

If I understand you right, then one way communication out from vim / gvim would work in at least if_py synchronously (blocking) or possibly even asynchronously (non-blocking)? I.e. autocommands calling python code that simply sends messages to TCP socket server?


So would a solution not simply be to fire off async python code on vim
events, from inside vim script, which in turn (the python code) talk to
the java TCP socket server? Getting complicated...
See github.com/MarcWeber/scion-backend-vim
But it blocks or segfaults or use client-server or netbeans or code C

I suppose then your suggestion of firing off async scheme code through
the vim scheme interpreter is better since there is better threading
support, meaning non blocking behavior?
Y - at least you should give it a try bevore spending days on writing C.
Sure, it looks like the best option thus far, if I'm understanding things correctly.

or decide that the Conq like implementation with little latency is good
enough. Eg you can then use on idle event of Vim to poll
background-thread about new messages.
It might very well be good enough, so I'll try this before if_scheme.

summary:

client-server: works: But calling into Vim does not always work
correctly (see vim-addon-xdebug). I tried working around it by calling
feedkeys several times which is good enough..

scheme: I haven't tested it. But from reading code it looks like its vim
asking scheme to run threads in a synchronized way. its you setting the
timer values. So this might be the fastest option.

autocommand (on idle):  some delay

netbeans: Never tried using it

For reference, netbeans is bi-directional between vim and vim controller (TCP socket server in my case). It's a defined protocol and eclim for example use it in the form of the vimplugin project for interfacing with vim. Eclim also use nailgun, which is a sort of JVM accelerator -- a JVM server running all the time that then cuts out JVM startup times. Autocommands in vim script call to java using nailgun in some manner (in the vim side of eclim), in addition to the messages to and from the netbeans protocol code inside vim.

Got very excited when first learnt about netbeans protocol, but as stated, not verbose enough. If modifying the netbeans protocl was an option, a minimal approach that could actually work would be to simply add an event (the editor -> IDE type of nb message) for cursor movement and key press. The controller could then ask vim via a command type nb message for more info if required.


vim-addon-async is based on client-server, there is a native patch which
doesn't work in gvim (by Bart)
vim-addon-async tries to offer an API which we can keep stable and
switch underlying implementations

Great, but not working in gvim is a problem.

Thanks a lot for the summary. The picture is getting ever clearer. Noted all your comments Mark and I'll take action accordingly:
1. see if conque_shell is good (fast) enough
2. get if_scheme enabled gvim and vim and experiment there
Lastly, imagine a very verbose feed from vim to which any IDE or whatever can subscribe so that the subscriber knows exactly what is going on in vim. Could netbeans protocol not be extended for this?

HTH
Marc Weber

TH a lot for sure! Thanks!

--
Kerneels Roos
Cell: +27 (0)79 696 6038
Skype: cornelis.roos

--
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui