Quick rust rant: Cargo's default requirements are ...
# random
w
Quick rust rant: Cargo's default requirements are insane. For a language that prides itself on safety and security - it should be falling into a pit of safety everywhere, especially with supply chain. If I type in the package version "1.2.3" - I'm typically not expecting the possibility of "1.99.99" as well. While I think npm versioning has too many options, at least if you type a full specifier, you get the full specifier and nothing else. Sane default. To take it a step further, I think without a range, caret, or tilde - you should enforce wildcards so people always know what they're getting into.
Copy code
Default requirements

Default requirements specify a minimum version with the ability to update to SemVer compatible versions. Versions are considered compatible if their left-most non-zero major/minor/patch component is the same. This is different from SemVer which considers all pre-1.0.0 packages to be incompatible.

1.2.3 is an example of a default requirement.

1.2.3  :=  >=1.2.3, <2.0.0
1.2    :=  >=1.2.0, <2.0.0
1      :=  >=1.0.0, <2.0.0
0.2.3  :=  >=0.2.3, <0.3.0
0.2    :=  >=0.2.0, <0.3.0
0.0.3  :=  >=0.0.3, <0.0.4
0.0    :=  >=0.0.0, <0.1.0
0      :=  >=0.0.0, <1.0.0
I'm currently going through Pants's dependencies to trim some fat - and every time I go into a Cargo.toml - I immediately have this thought. Every time.
h
Yeah, that is mental
w
The other one is that crates.io still (as far as I can see) mandated namespaced crates. Relying on a flat namespace is a great way to get name squatters and it just makes the dependency space more confusing. NPM eventually added, and I think JSR mandates namespaces. Even the standard library for Deno is namespaced: https://jsr.io/@std Makes fat-fingering a squatted package even harder if instead of:
Copy code
tokio = ...
axum = ...
prost = ...
I had to do:
Copy code
@tokio/runtime = ...
@tokio/axum = ...
@tokio/prost = ...
Becomes an org squatting issue, but that is a more tractable problem I think
This was recently triggered again because of: https://github.com/tower-lsp-community/tower-lsp-server/issues/3
tower-lsp
fork becomes?
Copy code
tower-lsp2
2tower-2lsp
hightower-lsp
tower-lzp
How do you name a fork of something that is unmaintained? Similar problem for
lsp_types
- there needed to be
ls_types
and I think Microsoft used
lsprotocol
for theirs. And for basic, short names that once could expect to be first-party rust-lang team? 2 of these are from rust-lang
Copy code
future =
futures =
log = 
rand = 
uuid =