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

Provide C API #491

Open
rawhuul opened this issue Oct 2, 2023 · 4 comments
Open

Provide C API #491

rawhuul opened this issue Oct 2, 2023 · 4 comments

Comments

@rawhuul
Copy link

rawhuul commented Oct 2, 2023

It would be wonderful to have C-API to syntect library similar to treesitter. This will open up a gate to lot more users to use this library.

@Enselic
Copy link
Collaborator

Enselic commented Dec 29, 2023

My preference would be do expose a C API of syntect in a third-party crate. Effectively a C facade in front of the Rust API that is maintained elsewhere.

(I will close this issue as "won't fix" at a later point unless other maintainers express a desire to maintain a C API of syntect.)

@rawhuul
Copy link
Author

rawhuul commented Dec 29, 2023

Okay, I will dig deep into the library and try to make a C wrapper of it in free time

@kojix2
Copy link

kojix2 commented Aug 4, 2024

I realized that with patience, you can create a C-API without knowing any Rust syntax by interacting with ChatGPT for hours. Although it may not work perfectly, I have generated C-APIs for some basic functions of the syntect library. All the Rust code, C code, and even the README were generated by ChatGPT. However, it took many hours of interaction, building code, reporting errors, and giving feedback, so it's not as easy as it sounds 🙃

It would be nice if skilled engineers created a proper C-API, but there isn't one available (everyone is busy). However, anyone willing to talk to AI patiently might be able to build a prototype C-wrapper.

https://github.com/kojix2/syntect-c

@rawhuul
Copy link
Author

rawhuul commented Aug 6, 2024

That’s nice, thanks. I will try experimenting with it.

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