4 ms·
Go is not "memory safe C". Go has garbage collector and that is not zero cost. Rust has zero cost abstractions, so Rust is sort-of "memory safe C". However,
by shp0ngle 8y ago
Go is not "memory safe C".
Go has garbage collector and that is not zero cost.
Rust has zero cost abstractions, so Rust is sort-of "memory safe C".
However, Rust is notoriously hard to learn, read and write in. So that sort of shows you that desugning low-level, zero-cost language is HARD
- bigato 8y agoThe OP didn't ask for zero cost abstractions. Furthermore, maybe "zero-cost" is not the best way to describe Rust abstraction; they may be zero cost for the machine at runtime, in exchange for a bigger mental burden on the programmer, thus being better labeled as a trade-off in more speed in exchange for more complexity. Whether this trade-off is worth it, will depend on some factors like the use case and the programmers involved. And the OP was actually complaining about the added complexity, thus my answer being Go.
- steveklabnik 8y ago> Furthermore, maybe "zero-cost" is not the best way to describe Rust abstraction "Zero-cost" has always been about runtime cost. Other costs are not part of the slogan. Everything always has a cost!
- majewsky 8y agoAnd notably, Rust didn't start the "zero-cost abstraction" meme, C++ did.
- steveklabnik 8y agoYup!
- RaleyField 8y ago> bigger mental burden on the programmer Only sometimes. For complex enough problems I think mental burden of writing and maintaining software in less complex language will become more burdensome than the intrinsic burden that comes with more complex language.
- vthriller 8y ago> Rust is notoriously hard to … read I've seen this argument a number of times before, but always discarded it as something that only people not familiar with post-1.0 syntax could bring (cause all those ~@[Omg]s really were hard to read). Do people really still struggle with its syntax, and if so, why? Coincidentally I personally really seem to struggle with reading sources in Go, although I'm yet to figure out why exactly it is the case and why I'm not as slow when reading sources in e.g. Perl.
- iopq 8y agoReally? Because I find let x = ~"blah"; to be more readable than let x = String::from("blah");
- rurban 8y agoRust zealots: please read your documentation about unsafe memory. And while you are there also about deadlocks. The best safe C derivate is D, but there are also some minor offsprings, like safe-C or mscc or the popular cfi option, the Intel bounds-checking library or safeclib. Most C compilers let you track the buffer bounds nowadays, but rarely someone uses it.