4 ms·
I think you might need to define what exactly you mean by "memory safe". There is an entire class of bugs common to C and C++ that absolutely never happen in J
by winter_blue 3y ago
I think you might need to define what exactly you mean by "memory safe".
There is an entire class of bugs common to C and C++ that absolutely never happen in JVM languages, CLR languages, Rust, etc. This particular class of bugs of bugs never happen by design, because the language design simply does not permit them to occur ever.¹
¹ I am obviously of course excluding bugs/exploits/unintentional-loopholes here that are in the JVM or CLR, or in the Rust compiler itself, that permit a program to "break out of its box", so to speak.
- bombolo 3y agohttps://doc.rust-lang.org/book/ch15-06-reference-cycles.html https://doc.rust-lang.org/book/ch15-06-reference-cycles.html
- winter_blue 3y agoThis is a super-well-known issue with reference counting in general. It would be something to deal with anywhere one uses reference counting exclusively. For example, this is a problem in Swift as well: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/automaticreferencecounting/#Strong-Reference-Cycles-Between-Class-Instances https://docs.swift.org/swift-book/documentation/the-swift-pr... Does that mean Swift is unsafe? No. All this does is create the potential for a memory leak. Which is nowhere close to being in the same category as a buffer overflow exploit. Also, I suppose one could write a garbage-collected pointer library for Rust, which adds cycle detection (and auto-deletion) on top of ARC.