5 ms·
> caught a multi-threading bug The compiler complained: “error[E0308]: mismatched types”
by joubert 6y ago
> caught a multi-threading bug
The compiler complained:
“error[E0308]: mismatched types”
- xiphias2 6y agoThat’s why it’s amazing, type safe efficient multi-threading without dynamic memory allocation with a nice syntax...it’s the holy grail of server programming.
- literallyWTF 6y agoYeah I don’t get it either. We’re supposed to be upset that it did it’s job? Lol?
- andrewflnr 6y agoIt would be nice if it was explicitly a borrowing-related message. That's the kind of thing I can see happening in a future rustc actually.
- xiphias2 6y agoYeah, the good thing is that the devs are always happy to take feedback on improving the error messages (like explaining differences between Fn/FnMut/fn here)
- thu2111 6y agoWhy would I want to write a server in a language that requires such awkward approaches to basics like coroutines and dynamic dispatch when I could use kotlin on the JVM and get pauseless GC, ultra fast edit/compile/run cycles, efficient and powerful coroutines, and eventually Loom which will eliminate the whole problem of coloured functions completely and let me just forget about coroutines? Multi threading bugs are not so common in real Java/Kotlin programs to justify this epic set of costs, in my view.
- ha_jo_331 6y agoOr even better: Go
- roca 6y agoGC always forces you into a tradeoff between pause time, throughput, and memory overhead.
- karlmdavis 6y agoHave you ever tried writing the same application on both a JVM language and in Rust, and then measuring the latency & throughput differentials? Blew my mind the first time. Of course, if speed isn’t a concern for you, then please carry on.
- xiphias2 6y agoGood luck getting Google's ad backend with 20ms latency budget and billions of dollars of revenue approved with the JVM. Therr are many tasks where what you suggests is just too slow and unpredictable. Don't get me wrong, I think JVM is great, it's just not systems level programming.
- thu2111 6y agoModern JVM GCs have pause times below 1msec. That's a new capability though so most people aren't yet aware of it. And Google's ads backend are hardly the definition of server. Their ads front-end for example always used to be in Java. Not sure what it is these days
- redis_mlc 6y agoEverything is "mismatched types" in Rust, literally it doesn't do any automatic type conversion (casting), so it's not the right language for most people.
- agumonkey 6y agoI believe haskellers would love (and maybe did) to encode commutativity and thread-safety in the type system :)