sciter-sdk / rust-sciter

Rust bindings for Sciter
https://sciter.com
MIT License
804 stars 76 forks source link

Package name should not include -rs #41

Open chris-morgan opened 5 years ago

chris-morgan commented 5 years ago

The package name should be sciter, not sciter-rs. Package and crate names should not include a rust- prefix or -rs suffix, because we already know it’s Rust.

(The crate name is already sciter, which is correct; but you should basically never specify lib.name in Cargo.toml; it’s almost always the wrong thing to do.)

pravic commented 5 years ago

Hi.

The intention was to show that this crate is a bindings library. During that time it was somewhat common (and -sys crates were not so popular). Nowadays it would be better to split it to a -sys crate and a library with high level Rust abstractions over the former.

May I ask why it should not include?

chris-morgan commented 5 years ago

-rs has never been popular and was already considered an error when crates.io was first released. Unfortunately, that opinion was not overtly stated anywhere in documentation or warnings inside Cargo or on uploading to crates.io—it was merely held in IRC channels and such—and so some people went and did it. The most obvious explanation at the time seemed to be that people’s repositories often had a rust- prefix or .rs or -rs suffix, which was quite understandable (you do often want to indicate the language in the repository name for bindings), and it grew from there.

The -sys convention did arrive a little later; and yes, splitting this repository into two crates sciter-sys and sciter would be a more idiomatic approach now.

Packages and crates should not include these prefixes and suffixes, because the very fact that you’re using them indicates it’s already Rust. rust-, -rs, _rs—these add nothing of semantic meaning, and only make it harder to find it: it makes sense that the canonical crate for Sciter should be called sciter, right?

pravic commented 5 years ago

I partly agree. But again, what if my library isn't canonical? What if someone will make a better library? He'll deserve the crates.rs/sciter URL (J.)

Anyway, it is indeed something to think about during the future improvements.

chris-morgan commented 5 years ago

Yeah, there has never been a good answer for that question, in any package manager. Sometimes you can pass the name off to someone else, but far too often in such cases the original user of the name is no longer around…

woubuc commented 5 years ago

In my opinion, the biggest reason to use the more obvious name sciter would be that people will try to add sciter as their dependency at some point. If there's no crate with that name, it will be very clear that they have to use a different crate. But the problem arises when a malicious actor comes in and takes the sciter name to distribute malware in people's code without them realising it. I don't know if something like this has happened yet in Rust, but it's definitely happened with other languages / package managers.

That's just my 2 cents. Other than that, personally it doesn't matter much to me. All I need the name for is to put it in my Cargo.toml file once so it makes no difference if I have to copy a few extra characters from crates.io :)