7 ms·
> Rust-based replacements I find it funny how Go was born to be a simpler C, but managed to get a lot of mindshare with Python developers that were writing sys
by sph 4y ago
> Rust-based replacements
I find it funny how Go was born to be a simpler C, but managed to get a lot of mindshare with Python developers that were writing system-level scripts and backend systems.
While Rust was born to be a better C++, but is getting a lot of traction with Javascript/Typescript developers, and you can start to see some similarities in the packaging and tooling philosophies of the two. (Ton of small packages, some that should probably part of the stdlib but anyone needs to use to stay sane: futures, thiserror, anyhow, for example. Also there starts to be a tendency to rewrite and release incompatible APIs that this time will solve all the problem of the previous iteration).
I guess the hype-driven junior developers saw how better Typescript is at managing Javascript's shortcomings, and now see static typed languages, especially one with some hype of its own behind, as the Messiah.
Let me add the disclaimer that I'm a fan of Rust before I get attacked for this controversial observation.
- acdha 4y agoI’m seeing a lot of Rust in the Python world, too, which I think makes sense as people want to avoid the hostility of C/C++ and expect developer ergonomics closer to the level they’re familiar with rather than the C/C++/Go-level toil.
- rob74 4y agoNot sure what you are thinking of when you put C, C++ and Go into the same category of "bad developer ergonomics" here? I found Go's developer ergonomics to be pretty welcoming, compared to C/C++ and also compared to Node for that matter...
- acdha 4y agoIt’s a spectrum where I’d definitely rank Go higher than the others but package management and error handling were historically a disappointment.
- cle 4y agoIt helps that Rust is probably the best language to use if you are targeting Wasm, which is mentioned in the discussion. Go can be compiled to Wasm too, but the fat runtime makes it a non-starter for many use cases. (I prefer Go over Rust for general purpose programming, and I wish that Wasm had an answer here so we can use less complex, cognitively-lighter languages.)
- barelysapient 4y agoHave you looked at TonyGo for WASM?
- kibwen 4y agoI'd say that Rust's crate ecosystem is of a different character than Node's. There's no culture of "microdependencies" like `is_odd` in Rust, likely because Rust's stdlib isn't small per se; it is slightly narrow (without things like HTTP libraries) but very deep (the modules that do exist are very thorough). Overall, Rust crates are "topic-oriented" rather than "convenience-oriented". Node achieves fine-grained APIs via a proliferation of small dependencies, whereas Rust does the same via feature profiles within a single crate.
- Thaxll 4y agoAnd yet Rust import tons and tons of package for anything, so yes you don't have that `is_odd` but your dep tree if very often bloated.
- deleted 4y ago[deleted]
- mplanchard 4y agoFor some definition of bloated, maybe. Our codebase at work has I think 15-20 crates in our workspace, powering two independent applications and three dev-tooling-related binaries. All of this provides the main functionality for our business. We have fewer than 500 Rust dependencies in our Cargo lockfile, including dev dependencies. Meanwhile, our relatively simple react frontend and graphql server written in TS have over 20k dependencies. It’s truly a different order of magnitude.
- Aeolun 4y ago20k? I’m willing to believe you can hit 5k, but that’s already stretching credulity. At some point all the common packages are installed.
- mplanchard 4y agoOkay you appear to be right! Running `yarn info -AR | wc -l` gets me 3,413, and I get the same number for `cat yarn.lock | rg '^".+":$' | wc -l` I remember running `yarn install` before we switched to `yarn 2` used to get us some absolutely insane number of packages being fetched in the 20k+ range, which is where my number came from, but I hadn't looked at it again in quite a while. I'll update my original comment. (edit: nvm it's too old to update, oh well)
- jamincan 4y agoRust has been seeing a lot of adoption from Python devs too, in part because of crates like PyO3 making interop fairly easy. I think Rust's appeal (and Go's for that matter) in these cases is that it offers high performance without a lot of the footguns of C and C++. This means that even if the language is challenging at first, the pay off is far more confidence that the compiled program is correct. It is curious that Rust seems to be the overwhelming favourite for new JS/TS tooling. The appeal of static typing from TS carrying over to Rust seems plausible, but in this case, the developer is favouring JS over TS for the initial rewrite, so I'm not sure how true that is.
- hajile 4y agoGo types are strictly inferior to Rust types. If I wanted an ideal GC'd language with good types, I'd pick StandardML to pour time and resources into instead of go as it's a better-designed language with similar performance, better types, more simple syntax, and with better-modeled concurrency.
- EMM_386 4y ago> I guess the hype-driven junior developers saw how better Typescript is at managing Javascript's shortcomings, and now see static typed languages, especially one with some hype of its own behind, as the Messiah. You can see the exact same thing with the transition from NoSql to SQL. At first it just seemed like added complexity, then that "ah ha" moment hit, and it clicked.