Skip to content
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

I'd like to ask why you chose to use bindgen but not cxx. #36

Closed
ghjdegithub opened this issue Oct 22, 2024 · 6 comments
Closed

I'd like to ask why you chose to use bindgen but not cxx. #36

ghjdegithub opened this issue Oct 22, 2024 · 6 comments

Comments

@ghjdegithub
Copy link
Contributor

No description provided.

@thewh1teagle
Copy link
Owner

thewh1teagle commented Oct 22, 2024

cxx is used for C++, and bindgen is for C. Since sherpa-onnx exposes a C API, we use bindgen. Even if it were C++, I wouldn't choose cxx. I worked with a cxx codebase a while ago, and I find that using bindgen along with custom C++ wrappers with C makes the code much more readable when writing bindings for a C++ library.

@thewh1teagle
Copy link
Owner

thewh1teagle commented Oct 22, 2024

For instance see this cxx based crate which in my opinion is not readable at all:
https://github.com/jkawamoto/ctranslate2-rs/tree/main/src/sys

Versus another small wrapper I created to C++ code:
https://github.com/thewh1teagle/knf-rs/tree/main/sys (See knfc folder)

@csukuangfj
Copy link

FYI: k2-fsa/sherpa-onnx#1455 provides a C++ wrapper for sherpa-onnx's C API.

@ghjdegithub
Copy link
Contributor Author

FYI: k2-fsa/sherpa-onnx#1455 provides a C++ wrapper for sherpa-onnx's C API.

What are the languages currently officially supported by the API, can you list them on the reademe?

@csukuangfj
Copy link

Please see
https://github.com/k2-fsa/sherpa-onnx?tab=readme-ov-file#supported-programming-languages

12 languages are supported by sherpa-onnx at present.

We may support more if needed.

Screenshot 2024-10-23 at 19 38 12

@ghjdegithub
Copy link
Contributor Author

officially

I mean to distinguish between official support and unofficial support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants