top | item 26407326

(no title)

joubert | 5 years ago

> caught a multi-threading bug

The compiler complained: “error[E0308]: mismatched types”

discuss

order

xiphias2|5 years ago

That’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.

andrewflnr|5 years ago

It 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.

thu2111|5 years ago

Why 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.

literallyWTF|5 years ago

Yeah I don’t get it either. We’re supposed to be upset that it did it’s job? Lol?

agumonkey|5 years ago

I believe haskellers would love (and maybe did) to encode commutativity and thread-safety in the type system :)

redis_mlc|5 years ago

Everything 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.