3 ms·
Typestates and reliance on `embedded-hal` traits are a particular pain. I think we're in a weird spot, where the language itself, and some of the build tools (L
by the__alchemist 5y ago
Typestates and reliance on `embedded-hal` traits are a particular pain. I think we're in a weird spot, where the language itself, and some of the build tools (Like those by the Knurling team) are outstanding, but the most popular libraries have made questionable design decisions, and have flaws that show almost immediately.
I'm curious how many teams are developing new projects using Rust, but staying away from the open source ecosystem.
- codeflo 5y agoIt’s not just crates.io. I have a minimal, no Libc, no runtime dependencies Windows project for fun that compiles to a tiny executable of only a few kilobytes. If you’re going down this minimalist/better C route, you increasingly have to avoid large parts of the Core library as well, which is becoming more bloated by the minute. The culture seems to move in the direction of “avoid unsafe at all costs” (even where that makes the API so complicated that it hurts correctness in practice) and “avoid dynamic dispatch at all costs” (even where that hurts performance).
- vbsteven 5y agoYour comment made me wonder if crates.io is starting to show some of the same issues that npm has. Lots of small packages, not always consistent, focussed on one use case that make other use cases non-optimal. The recent posts about Rust in Android shows a side of this. They are avoiding Cargo in favor of plugging in their own build system. Use the language for its benefits and avoid the ecosystem (partly).
- rcxdude 5y agoI think the case with embedded code on crates.io is more along the opposite: they're trying to make the experience as consistent as possible by defining common interfaces for embedded drivers so code can run consistently with different hardware or libraries. The problem is it's really hard to design such abstractions, especially safely, when you can't make many assumptions about the hardware it'll be abstracting over and efficiency is paramount.