Rust
Table of Contents
:CUSTOM_ID: rust
Picked up - it seems like an extremely good book. Excited to read it. The topics are quite interesting! - I really appreciate that the book isn't coming from a "rust is the greatest ever of all time" perspective. They immediately point out issues with dependencies.. etc.
1. Links
- Language Specific:
- Videos:
- JonGjengset's videos were recommended in the room.
2. Things I strongly dislike:
- No spec.
- Inability to bootstrap itself. People argue "but the front-end is
fully bootstrapped". IMO this is splitting hairs. I can't take a
rustcand build anotherrustc. - Cargo re-implements
git, but poorly.- For example, it respects
/etc/gitconfigbut ignores local.git/configoverrides. This means that every single time I do acargo installof something I am prompted to allow access to my ssh key for every single dependency!
- For example, it respects
- The dividing line between
crateandstdlibleans way too far to thecrateside of things.- Remote dependencies are needed to do virtually everything. There
isn't even a
randpackage in the standard library.- Other missing things of note:
- regex
- date / time
- "low-level I/O futures and traits are not yet provided in the standard library"
- http
- Other missing things of note:
- This creates a HUGE exposure. Now instead of trusting a core team of developers, I have to put trust in every single dependency in addition to the core team. Any one of them is a potential supply chain injection point!
- Remote dependencies are needed to do virtually everything. There
isn't even a
Implicit returns.
- Semicolon on return changes behavior:
fn add1(a: i32, b: i32) -> i32 { a + b } fn add2(a: i32, b:i32) -> i32 { a + b; } fn TypeOf<T>(_: &T) { println!("{}", std::any::type_name::<T>()) } fn main() { let a = add1(1, 2); let b = add2(1, 2); TypeOf(&a); TypeOf(&b); }
- At least the compiler errors on this though.
- Overly complex - seeming to solve self made problems:
Rust let b: i32 = 20; let c = 30i32; let d = 30_i32 - Crate breakage across minor releases of rust.
- Pre-Rust 1.45
this
feature was marked as
unstable. But post 1.45 it wasstable. - Libs that use this new feature only bumped their semver patch level when they moved to 1.45. This caused unexpected breakage. - For example: async-process v1.0.1 was broken. - This leaves the ecosystem needing to "always be on the latest rust" - which is not a desirable place to be, especially given you are forced to rewrite things because of breakage!
- Rust 1.80 breaks a ton of stuff:
https://github.com/NixOS/nixpkgs/issues/332957
- Continuing to see fallout from this!
- Pre-Rust 1.45
this
feature was marked as