Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
kobenz62199dthank god it's "cargo" and not "rust", name it "rust-something" and it's rust foundation on your ass 🙄
-
kobenz62199dps: I feel like most of what's been added ad-hoc to rust fails to meet the language's principles
-
What's the use case for naming anything "cargo-something" while knowing that the package manager is called cargo? I'd never name anything "npm-something" for js without it being an npm tool.
-
lorentz1495498dI think convention-over-configuration is fundamentally different from implicit behaviour. Implicit behaviour is decided based on potentially broad context. If rust treats any file called build.rs as a build script, that's implicit behaviour. If only src/build.rs is considered, it's CoC.
-
lorentz1495498dmy completely contrived idea here is that it's CoC if it's not harder to check the convention than it would be to check the configuration.
-
lorentz1495498dI'm a big fan of CoC by the way. You learn what kind of files Cargo treats specially once and from then on you'll be able to quickly read every Rust project on github.
-
lorentz1495498dAuditing all of your NPM dependencies is a nightmare because they all use different build systems and structures so just entering a project takes minutes. In Rust you can instantly start reading the code, and only need to read the part that applies to your use case.
-
lorentz1495498d@jestdotty https://doc.rust-lang.org/cargo/ is a useful read, though I agree that it sorely needs a complete example of package structure with all special files included.
I finally checked build scripts, they have to be in the package root, outside /src. Rust should complain if you put a regular file there because it's not actually addressable from the real source files inside /src.
Related Rants
I do not like rust's choice to just infer something from how it is named
like if you install a package that begins with "cargo-something" then it becomes a cargo command. this feels janky
also turns out if you have a build.rs file it will build stuff for you when compiling? I just ran into this being described in the docs. well guess what. I have a build.rs file. it isn't being used for that though. I mean hasn't caused any problems, or has it?! I DON'T KNOW
config options seem more explicit than this naming nonsense. I just had to rename my project everywhere so it can be a cargo command. ffs now my git links are broken and shit.
I thought rust was verbose because it knew the merits of being explicit. can they stick to their principles pls
rant
rust
spaghetti