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

Feat/stone ffi #364

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

Feat/stone ffi #364

wants to merge 12 commits into from

Conversation

tarkah
Copy link
Collaborator

@tarkah tarkah commented Oct 29, 2024

No description provided.

Copy link
Member

@ikeycode ikeycode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mildly terrifying =) Was it not possible to autogenerate the header from the extern "C" functions..? My only nitpicks atm are missing docs/SPDX headers. I assume the renames are required for FFI exports, and unavoidably introduce the verbosity / far reach of changes?

@tarkah
Copy link
Collaborator Author

tarkah commented Nov 8, 2024

Was it not possible to autogenerate the header from the extern "C" functions..?

The header is being auto generated by cbindgen, checkout build.rs!

I assume the renames are required for FFI exports, and unavoidably introduce the verbosity / far reach of changes?

Lol yeah cbindgen operates on type names only, not fully qualified paths, so any "duplicate" name, even from different modules, collide and it'll only emit one of them. So I had to switch the entire crate to fully qualified type syntax :/

My only nitpicks atm are missing docs/SPDX headers.

👍 Yup we need 100% documentation and outlining safety & lifetimes will be important. Any necessary allocations happen on the rust side. The consumer needs to copy out any StoneStrings we allocate in Rust to C before destroying the reader and Rust drops it all. Since C is devoid of lifetimes, le documentation must be solid.

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

Successfully merging this pull request may close these issues.

2 participants