Making C++ safe without borrow checking, reference counting, or tracing GC
1–10 of 226 posts
Re: Making C++ safe without borrow checking, reference counting, or tracing GC
#2Thomas Neumann's current proposal for memory safe C++ using dependency tracking:
- https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p27...
Google's proposal for memory safety using Rust-like lifetime analysis:
- https://discourse.llvm.org/t/rfc-lifetime-annotations-for-c/...
- https://github.com/google/crubit/tree/main/lifetime_analysis
Re: Making C++ safe without borrow checking, reference counting, or tracing GC
#3Re: Making C++ safe without borrow checking, reference counting, or tracing GC
#4Re: Making C++ safe without borrow checking, reference counting, or tracing GC
#5https://dl.acm.org/doi/10.1145/3274694.3274705
(though maybe that's covered by what the author meant by "arenas").
Re: Making C++ safe without borrow checking, reference counting, or tracing GC
#6See also: Thomas Neumann's current proposal for memory safe C++ using dependency tracking: - https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p27... Google's proposal for memory safety using Rust-like lifetime analysis: - https://discourse.llvm.org/t/rfc-lifetime-annotations-for-c/... - https://github.com/google/crubit/tree/main/lifetime_analysis
It will never be perfect, but every little improvement helps.
Re: Making C++ safe without borrow checking, reference counting, or tracing GC
#7it's not about making C++ memory safe, but about describing a safe subset of C++
Re: Making C++ safe without borrow checking, reference counting, or tracing GC
#8it's not about making C++ memory safe, but about describing a safe subset of C++
Ideally we would have -fsafe and [[unsafe]], but it will take years for something like that.
Re: Making C++ safe without borrow checking, reference counting, or tracing GC
#9> Borrow checking is very fast, and helps avoid data races.
One thing many people seem to assume is that not having to care about memory means you can program faster and get to your goal faster. As the author here seems to do. However as it turns out, if your program is more complex than a ~100-1000 lines of code, explaining in a explicit way who owns what and who gets to change state when, is a very useful way to avoid bugs.
Saoirse Shipwreckt aka withoutboats mentioned this a while ago in https://without.boats/hire-me/
> Rust works because it enables users to write in an imperative programming style, which is the mainstream style of programming that most users are familiar with, while avoiding to an impressive degree the kinds of bugs that imperative programming is notorious for. As I said once, pure functional programming is an ingenious trick to show you can code without mutation, but Rust is an even cleverer trick to show you can just have mutation.
and later follows up on this in https://without.boats/blog/revisiting-a-smaller-rust/
> I still think this is Rust’s “secret sauce” and it does mean what I said: the language would have to have ownership and borrowing. But what I’ve realized since is that there’s a very important distinction between the cases in which users want these semantics and the cases where they largely get in the way. This distinction is between types which represent resources and types which represent data.