(no title)
IceHegel | 5 months ago
But what Rust has is the best tooling bar none(cargo, build system, compile time checks, ease of first use). The tooling is actually more important than the borrow checker and memory safety in my opinion.
If I clone a Rust repo, it’s actually easier to compile, test, and run the code than any other language. It avoided the fragmentation of JS/TS (npm, yarn, pnpm, bun, deno) and dep hell of Python (which was a nightmare until uv).
If Rust didn’t have the syntax warts (macros), it would be eating the world.
foota|5 months ago
AnimalMuppet|5 months ago
Here's a struct that maintains an invariant - say, that field a is less than field b. That invariant should be set when it is created.
You find a bug where a is greater than b. Where is the bug? With a struct, it can be anywhere in the code - any line that touches the struct. But with a (well designed) class, a and b are private, and so you only have to look at lines of code within the class. The surface area where the bug can be is much smaller.
The bigger the code base and the more well-used the class is, the more this matters.
the__alchemist|5 months ago
mrheosuper|5 months ago
As a C programmer, i'm always a little panic how a small Rust Program can pull in that many crates when compiling.
james7132|5 months ago
I've definitely cloned down my fair share of C projects, mashed the make command into my terminal, and watched the gcc/clang logs fly by and never batted an eye beyond checking the sha256sum on any downloaded tarballs.
There's a valid argument to be made about supply chain attacks, but there does exist tooling to lock that down, and I would argue that any serious software development firm should be auditing every third party dependency they take on.
sitzkrieg|5 months ago
zig is very comparable, and much faster at doing so. zig also comes with a build system, libc and can compile c programs. its a better c compiler and build system than most, lol.
treyd|5 months ago
heavyset_go|5 months ago
Can you mix Zig libraries written X years ago with modern Zig? Will today's code work in 5-10 years if I want to use it in a project then?
AbuAssar|5 months ago
just use npm, the others are just more options, thersr is no "fragmentation"
iberator|5 months ago
hu3|5 months ago
I beg to differ because Go has a large standard library which means less dependencies than Rust on average.
AlotOfReading|5 months ago
My experience with random rust projects is that they usually "just build", with limited exceptions like weird embedded stuff.