syntect
syntect copied to clipboard
Provide C API
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.
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.)
Okay, I will dig deep into the library and try to make a C wrapper of it in free time
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
That’s nice, thanks. I will try experimenting with it.