News for hackers. Stuff that matters.
Re:D as a Better C by steveklabnik on Wednesday August 23, 2017 @03:10PM (#15084230)
> What may be initially most important to C programmers is memory safety in the form of array overflow checking, no more stray pointers into expired stack frames, and guaranteed initialization of locals.

Are there any docs about this anywhere? http://dlang.org/spec/betterc.html doesn't really describe this stuff.

Re:D as a Better C by zombinedev on Wednesday August 23, 2017 @04:38PM (#15084856)
It is not described in the betterC page as these features are not new for D. The betterC page only describes the differences versus the full D feature set.

Documentation for the individual features mentioned:

http://dlang.org/spec/function.html#safe-functions

> array overflow checking

http://dlang.org/spec/arrays.html#bounds

> guaranteed initialization of locals

http://dlang.org/spec/type.html http://dlang.org/spec/declaration.html#void_init

> no more stray pointers into expired stack frames

DIP1000 describes D's scoped pointers approach to memory safety - https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md. This is work in progress and the document doesn't reflect latest state of things. Conceptually, scoped slices/pointers/references are similar to concept of borrowing that you guys have in Rust.

Re:D as a Better C by steveklabnik on Wednesday August 23, 2017 @04:45PM (#15084911)
Great, thanks! That makes sense, but it wasn't clear to me in the post.