Okay, adding #swift Automatic Reference Counting (ARC), which is thread safe, to what my dream #programmingLanguage should have. Compared to Swift, #nim their preferred implementation, ORC, doesn’t leak memory when dealing with reference cycles. Although I don’t know if #nimlang their implementation it thread safe, as well.
Maybe my theoretical #languageDesign should warn, but leak upon reference cycles. It seems to make the implementation easier.
References:
Nim
- https://nim-lang.org/docs/mm.html
Swift
- https://docs.swift.org/swift-book/documentation/the-swift-programming-language/automaticreferencecounting/
- https://clang.llvm.org/docs/AutomaticReferenceCounting.html
Rust leaking on memory cycles
- https://doc.rust-lang.org/book/ch15-06-reference-cycles.html
- https://doc.rust-lang.org/std/sync/struct.Arc.html