News for hackers. Stuff that matters.
Re:Ask HN: Why is there not a memory-safe C? by shp0ngle on Thursday May 24, 2018 @07:54AM (#17143095)
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

Re:Ask HN: Why is there not a memory-safe C? by bigato on Thursday May 24, 2018 @08:05AM (#17143137)
The 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.
Re:Ask HN: Why is there not a memory-safe C? by steveklabnik on Thursday May 24, 2018 @10:22AM (#17144218)
> 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!

Re:Ask HN: Why is there not a memory-safe C? by majewsky on Thursday May 24, 2018 @10:21PM (#17150161)
And notably, Rust didn't start the "zero-cost abstraction" meme, C++ did.
Re:Ask HN: Why is there not a memory-safe C? by steveklabnik on Friday May 25, 2018 @02:09AM (#17151034)
Yup!
Re:Ask HN: Why is there not a memory-safe C? by RaleyField on Thursday May 24, 2018 @11:36AM (#17145036)
> 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.

Re:Ask HN: Why is there not a memory-safe C? by vthriller on Thursday May 24, 2018 @08:24AM (#17143245)
> 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.

Re:Ask HN: Why is there not a memory-safe C? by iopq on Friday June 01, 2018 @06:57AM (#17204211)
Really? Because I find

    let x = ~"blah";
to be more readable than

    let x = String::from("blah");
Re:Ask HN: Why is there not a memory-safe C? by rurban on Thursday May 24, 2018 @08:53AM (#17143446)
Rust 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.