Closed iazel closed 7 years ago
Implementing a easily parsable output-input schema would probably be a good thing. But I can't see any ups with IPC. The only thing I could see is that it would make it a lot easier to accidentally introduce memory leaks.
I think instead that IPC is pretty cool because you don't need to pass the input every time, saving quite some time for big and frequently used inputs (eg: all files in a big project repo) and open up to a possible pre-processing step that will make the algorithm computation even faster!
It's true it can introduce memory leaks, but I'm sure we can also fix them! ^^
Hi @Iazel, thanks for the issue but I will not be implementing this. I intend to keep fzy minimal and unix-y.
You're also welcome to fork fzy and implement this yourself. choices.c
and match.c
should fix this usecase well and need minimal (if any) changes.
I keep thinking on how awesome would be to have a server mode to give a much better IPC so that it's easier to build plugins with this kind of functionality, eg: a nvim plugin.
My current plan is to use Unix Domain sockets and to provide 4 operations:
bucket
, which is basically a container for the provided inputs and can be searched multiple time.The buckets will be stored in memory for now, but next iterations could introduce a persisting operation.
Right now I think it would be easy to provide some custom protocol to build it on, like:
However I'm also considering to use msgpack for easier extensibility; the problem is that I've never used it and could take some time to start with xD
What do you think? Any suggestion? :)