Are there other general purpose programming languages besides Objective-C +ARC and Swift which target the llvm and use static compile time Automatic Reference Counting for memory management?
Asked
Active
Viewed 321 times
-3
-
this doesn't look like a better fit here than it was [at Stack Overflow](https://stackoverflow.com/questions/60411447/what-programming-languages-besides-apple-swift-use-the-llvm-compile-time-automat), sorry. See [help/on-topic] – gnat Feb 26 '20 at 12:57
-
@gnat Modified my question to be more precise and removed the swift tag it's not a question about swift! – v217 Feb 26 '20 at 13:55
-
https://en.wikipedia.org/wiki/LLVM has a list of supported languages that is relatively short. You can go through each one and look at their memory management features. – Robert Harvey Feb 26 '20 at 14:37
-
Could you explain what you mean by compile time ARC please? Do you mean ARC elision optimisation at compile time or something else? – Alex Feb 26 '20 at 14:55
-
@Alex Swift works without a garbage collector which decides at runtime which memory is freed like eg. go. In Swift like in Rust it is decided at compile-time, when and which memory is freed , only that the design choices are quite different. – v217 Feb 26 '20 at 15:28
-
@v217 ARC is a runtime mechanism. Swift adds retain and release points at compile time but there’s a runtime cost. Rust’s stair borrow checker does not have a runtime cost. It’s purely compile time. – Alex Feb 26 '20 at 21:49
-
@Alex Yes, but in comparison to eg. Go's garbage collection, the runtime is *predictable* and efficient. That's why I am interested in languages like Swift. – v217 Feb 27 '20 at 06:47
-
Real-time garbage collectors with guaranteed predictable pause times have existed for a looooong time. The oft-stated myth that GC causes long unpredictable pauses and is thus unsuitable for real-time is just that: a myth. Check out IBM's Metronome GC, for example, which has *worst-case* pause times shorter than an operating system context switch. – Jörg W Mittag Feb 27 '20 at 21:03
1 Answers
0
This is most likely handled by treating Swift references similar to C++ smart pointers, except for slightly different implementation. So there will be very little in LLVM itself.
Objective-C + ARC is very similar.

gnasher729
- 42,090
- 4
- 59
- 119
-
Sorry I forget to add Objective-C. Otherwise I would *accept* this answer! I will correct my question. Objective-C is also mentioned in the cited wikipedia article. – v217 Feb 26 '20 at 15:31