-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lua, Ruby, Haskell, Go Language bindings and FFI support #48
Comments
Python and Node.js are mostly done. I want to test them a bit more before uploading to pip and npm. Haskell and Ruby were trickier.
|
Would you consider Go bindings (using cgo)? If it’s possible to call the library from pure C (exposing a C header file) this will be easy (and I can help with this). |
That sounds like a good idea to me
I built one here: https://github.com/e-dant/watcher/blob/next/watcher-c/include/wtr/watcher-c.h The C project builds as a static or shared library. It has some basic tests and examples (but of course the majority of our tests are elsewhere). The C api may change, but not in dramatic ways. (You'll notice a second pipe-based api there, intended to make some language bindings easier. I'm thinking of removing it.) |
Thank you :) |
Would you prefer bindings to be in this repository (a Go module) or in a separate one? |
Entirely up to you. This repo would work. |
If you choose to set it up in this repo, would you mind adding a little blurb for Go in the changelog for 0.12? Please do add an @dunglas to those parts of the changelog if you don't mind. I'll cut a release soon. (Whenever Github resolves this |
Would you consider passing the wtr_watcher_event by address to the wtr_watcher_callback, instead of by value? Specifically LuaJIT ffi does not support callback with pass by value argument. Fyi, libuv had this discussion too. |
Yes, I think that's worth exploring. While the project is still major version 0, I do try not to break things... but portability is important. Maybe another function, which passes events by reference, is appropriate here? Maybe another function which, instead of being callback-based, is pipe-based, is also appropriate? (Would that make things even easier?) |
Not sure how a pipe-based API would look like... But I'd be content with the current callback based API with pass by addr argument, which would already make LuaJIT ffi easy. :) |
WIP on 1f0853d I want to add some documentation and roll over some bikeshedding stuff before cutting a release. Re bikeshedding:
|
My 2 cents: prefer breaking the API while it's still in 0.x than inherit a badly named or designed API for the whole life of the project 😅 |
There are some languages with ecosystems which could benefit from this filesystem watcher.
This is an efficient, reasonably well tested filesystem watcher with a small, relatively stable API.
There isn't much to expose or package.
I think this is mostly a matter of figuring out the "right way" to expose a library with a C ABI to these languages, and then just doing it.
The text was updated successfully, but these errors were encountered: