58 ms·
"really should be" ? "in C# or Java" ? where do you even base these claims? Do you know what C# and Java threads have that Rust doesn't? data races. And don't
by laerus 2y ago
"really should be" ?
"in C# or Java" ?
where do you even base these claims? Do you know what C# and Java threads have that Rust doesn't? data races. And don't get me stated on the biggest paradigm failure that is OOP.
- bigtimesink 2y agoProjects I've seen at work. Projects posted on Hacker News. Data races aren't usually an issue for backend services, and modern Java/C# is multi-paradigm.
- pdimitar 2y ago[flagged]
- lostmsu 2y ago> Data races aren't usually an issue for backend services I beg to differ unless all your logic is in the database with strong isolation guarantees. Speaking of C# for backends that are using EF actively, I bet there are bugs in pretty much all of them caused by incorrect applications of optimistic concurrency.
- legulere 2y agoBoth have a garbage collection though that lead to higher developer productivity than compared to rust's affine types.
- brink 2y ago> higher developer productivity Where have you been the past 5 years? Rust developers are insanely productive. Can we put this myth to rest already? Rust being an "unproductive language" is thoroughly dis-proven.
- hello_moto 2y agoRust is the silver bullet we all been waiting for?
- ramon156 2y agoNo, that's the other end of the stick. Its en par with other languages
- hello_moto 2y agoWell, put any language against Rust and Rustaceans would argue Rust is better than those languages so ... Silver bullet no?
- chasd00 2y agoIf the word “Rustaceans” is actually in common use then rust loses by default.
- neonsunset 2y agoThere are domains where C# (and F#) productivity stems from similar reasons why writing a game in something that isn't Rust might be more productive without even sacrificing performance (or, at least, not to the drastic extent). I can give you an example: var number = 0; var delay = Task.Delay(1000); for (var i = 0; i < 10; i++) { Task.Run(() => { while (!delay.IsCompleted) { Interlocked.Increment(ref number); } }); } await delay; How would you write this idiomatically in Rust without using unsafe? To avoid misunderstanding, I think Rust is a great language and even if you are a C# developer who does not plan to actively use it, learning Rust is of great benefit still because it forces you to tackle the concepts that implicitly underpin C#/F# in an explicit way.
- pdimitar 2y ago> How would you write this idiomatically in Rust without using unsafe? Channels and selects. It's trivial.
- neonsunset 2y agoPlease post a snippet.
- brink 2y agouse std::{ sync::{ Arc, atomic::{AtomicBool, AtomicUsize, Ordering}, }, time::Duration, }; fn main() { let num = Arc::new(AtomicUsize::new(0)); let finished = Arc::new(AtomicBool::new(false)); for _ in 0..10 { std::thread::spawn({ let num = num.clone(); let finished = finished.clone(); move || { while !finished.load(Ordering::SeqCst) { num.fetch_add(1, Ordering::SeqCst); } } }); } std::thread::sleep(Duration::from_millis(1000)); finished.store(true, Ordering::SeqCst); }
- neonsunset 2y ago
- homebrewer 2y agoEven when it's used by mediocre developers, which is probably more than 90% of us, myself very much included? All I've been seeing is Rust being used by very enthusiastic and/or talented developers, who will be productive in any language.
- lmm 2y ago> Rust developers are insanely productive. If your baseline is a language that is missing some features that were in standard ML, sure. If you were already using OCaml or F#, Rust doesn't make you any more productive. If you were already using Haskell or Scala, Rust's lack of HKT will actively slow you down.
- legulere 2y agoLonger compile times prolong iterative programming processes and having to take care of memory management through linear types adds restrictions on how you can express code and leads to additional mental burden. This can be part of a trade-off, where you get things in return (no runtime/gc), but your typical web app I don't see much advantages.