divvun / libdivvun

lib for running gramcheck and other pipelines + cli; modules for CG→spelling, CG→feedback, tagging blanks
https://giellalt.github.io/proof/gramcheck/GrammarCheckerDocumentation.html
GNU General Public License v3.0
9 stars 1 forks source link

Plain C interface / Rust bindings #17

Open unhammer opened 5 years ago

unhammer commented 5 years ago

I see neither Rust nor plain C on http://swig.org/ 's list of "Exits" (there was a 2012 GsoC project on a C target, but I don't see any mention that it was ever merged and it was listed as experimental 14 days ago).

mbrubeck says bindgen might be able to create bindings from rust to C++: https://rust-lang.github.io/rust-bindgen/cpp.html – there are some caveats there, so I guess it's a matter of Try It And See for someone who's good with Rust.

So the alternatives seem to be:

  1. manually write a C interface with extern C etc. It'd work, but be annoying to maintain two sets of interfaces (maybe less typesafe than SWIG too)
  2. use SWIG, if/when the C target works and bind to C from Rust
  3. use Rust bindgen, if that works (no C interface though)

(based on conversation here https://giella.zulipchat.com/#narrow/stream/129301-gramcheck/topic/libdivvun.20C.20interface )