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

Maybe just call it mscorlib? #3

Open
crlf0710 opened this issue Aug 2, 2018 · 4 comments
Open

Maybe just call it mscorlib? #3

crlf0710 opened this issue Aug 2, 2018 · 4 comments

Comments

@crlf0710
Copy link

crlf0710 commented Aug 2, 2018

It is unusual to include the word "safe" in Rust, since anything unsafe in Rust is opt-in.

@ZerothLaw
Copy link
Owner

It's part of a common set of nomenclature when dealing with ffi. The first crate is just straight ffi bindings, with a suffix, sys. The next layer up deals with and wraps the unsafe bits (raw pointers, conversions, etc,) and has a suffix of safe.

Consider odbc-safe: https://crates.io/crates/odbc-safe

@crlf0710
Copy link
Author

crlf0710 commented Aug 2, 2018

The -sys naming is conventional, since it's special and must properly handle linking. But i think the -safe naming is not. Actually I think it's really rare...

https://crates.io/categories/api-bindings

@ZerothLaw
Copy link
Owner

Sorry, this fell by the wayside with other stuff happening in my life.

So I think the situation with odbc, odbc-safe, odbc-sys is that there are three layers and there needs to be some distinguishing. I wasn't sure how many layers I'd eventually need, so I went with the future-proofed path in case I did need 3. Does that make sense?

@crlf0710
Copy link
Author

Sure. It's just the one without any suffix is user/downstream-oriented.

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

2 participants