4 ms·
You should check out rust. The compiler reasons about side effects + parallelization, and testing for you, but you get (nearly) complete low-level control. As
by hedora 4y ago
You should check out rust. The compiler reasons about side effects + parallelization, and testing for you, but you get (nearly) complete low-level control.
As a bonus, you'll be able to write insufferable comments like these in HN threads.
- Quekid5 4y agoNot to put too fine a point on it, but "side effects" != mutation. Also: The level of control offered by Rust comes at a steep cost compared to GC'd languages.
- adamzen 4y agoI am relatively new to rust, but motivated to learn it right now. Could you elaborate on what the cost compared to garbage collected languages is?
- actinium226 4y agoI think he means two things, mind you I'm not very familiar with Rust, but I've done a lot of safety-critical C/C++, which is sort of like Rust 1. There's a mental cost on the programmer. You have to learn all the ins and outs of things like the "borrow checker" (a Rust concept) and it's on you to understand the rules and how to use them 2. It can slow down compile time. As your program gets bigger, the compiler is doing more work to check that it's valid code, so that will slow you down.
- Quekid5 4y agoI was mostly thinking of the #1 mentioned by actinium226 in a sibling post, fwiw. The main other thing I was thinking of was that GC languages sometimes have features that are very hard to support sensibly in non-GC languages: My favorite example is the higher-kinded types (HKT) which e.g. Scala and Haskell support. These can incidentally be used to "tame" side effects in a very principled way (via Monads). Another example would be lazy computation/values. (Other applications of HKTs are validation integrated with parsing while still providing the maximum actionable feedback to users.)