Remix.run Logo
carlmr 2 days ago

>I will very easily write a faster parallelizable program in Java, before I get the C one even remotely correct and then we haven't even taken into account every future maintenance cost.

Even better in Rust. You get great memory safety guarantees from the borrow checker helping guide your parallelization, while still being fast and GCless.

It's the best of both worlds.

>Also, the way C devs often hide the cost is simply.. less efficient code like copying stuff right and left, etc, which can actually be more "bravely" avoided in managed languages.

I'd say Rust is again the easiest way to avoid unnecessary copies without sacrificing safety.

gf000 a day ago | parent [-]

For a subset of algorithms, you are right.

For certain other kind of concurrent algorithms, you are in a world of pain and Rust's borrow checker simply refuses to compile a large set of otherwise correct programs.

carlmr a day ago | parent [-]

I've never had this issue. Use the built-in datastructures that provide that functionality and you're good

gf000 14 hours ago | parent [-]

Just because you haven't had it doesn't mean it doesn't exist. The built-ins just use unsafe extensively for these kind of algorithms - though that is of course completely fine here and there, since you will only use the safe APIs.