Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Feature Request - C API #93

Open
VarLad opened this issue May 1, 2023 · 3 comments
Open

Feature Request - C API #93

VarLad opened this issue May 1, 2023 · 3 comments

Comments

@VarLad
Copy link

VarLad commented May 1, 2023

Is it feasible to ask to provide some kind of C API for working with Glazier, so it can be used in other languages?
This would be really helpful for using it in other languages, but I'm not sure how easy would this be.

I'm willing to potentially put time into this, given acceptance and proper guidance for this proposal.

@xStrom
Copy link
Member

xStrom commented May 1, 2023

I haven't thought about this deeply, but I imagine C ABI being too restrictive of a propety for Glazier proper. However it should be possible to write a shim layer (in Rust) that provides a C ABI. Some ownership bookkeeping might be required.

@VarLad
Copy link
Author

VarLad commented May 1, 2023

@xStrom
Would the said shim layer exist with the code of Glazier or would it have to be a separate library?
Do you have a very small code example or a repo of similar effort to show what it would look like?

@jneem
Copy link
Collaborator

jneem commented May 1, 2023

It could live in either place, I think. I have a small library with a C api defined here if you want an idea of what it could look like. It that case, it is defined together with the rust library, using feature flags to enable or disable it.

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

No branches or pull requests

3 participants