News for hackers. Stuff that matters.
Re:Ask HN: Why is there not a memory-safe C? by nurettin on Thursday May 24, 2018 @09:02AM (#17143526)
Not sure how that makes the situation any different.
Re:Ask HN: Why is there not a memory-safe C? by blackflame7000 on Thursday May 24, 2018 @08:17PM (#17149646)
Shared_pointers are thread-safe from a creation and deletion aspect. Futhermore, you can use weak_ptrs to reference a shared_ptr and use that where you suspect a pointer might be deleted to a resource that is still required. Furthermore, the trusty old keyword const can make the pointer immutable thereby mitigating the problem. (And don't say what about const_cast.. because that's undefined behavior masquerading as acceptable because it rarely causes side-effects.
Re:Ask HN: Why is there not a memory-safe C? by nurettin on Friday May 25, 2018 @12:23AM (#17150597)
My point is, "making sure x happens" or "follow this sure to work design philosophy which will break once the system is more complex than a game of billards" is not a guarantee to anything, therefore none of the smart pointers solve any problems about deadlocks caused by resource sharing.
Re:Ask HN: Why is there not a memory-safe C? by blackflame7000 on Friday May 25, 2018 @02:53AM (#17151241)
I can tell you're not familiar with the latest C++ developments. RAII solves deadlocks so do things like std::lock_guard. C++ 11 is as safe as you're ever going to get while still maintaining fine granularity over the control of the system.

C++ applications are some of the most vastly complicated programs in existence so I don't follow the argument that they break on projects larger than a breadbox.

Re:Ask HN: Why is there not a memory-safe C? by nurettin on Sunday May 27, 2018 @07:38AM (#17166498)
I am familiar with all developments in C++ since 2001, that is why I am pretty sure that moving mutex primitives from platform level to language and memory model level has not changed anything in terms of deadlocks and you are just googling new stuff as we go.
Re:Ask HN: Why is there not a memory-safe C? by blackflame7000 on Monday May 28, 2018 @03:21AM (#17171032)
You should really check out the new stuff. It's a barely even the same language anymore. They've made many improvements.