Hacker News new | ask | show | jobs
by _orz_ 705 days ago
That’s just not true, Swift doesn’t use GC but reference counting.
2 comments

Reference Counting is a type of GC.
Stop using words you don't understand, it's dishonest.
Sorry? So obviously with GC one means managed GC. Otherwise the comment above doesn’t make any sense at all since then Rust itself would use GC because it also supports reference counting.

Strictly speaking you could obviously say reference counting is a form of GC. So to avoid GC you then surely recommend people to use C since that, in contrast to Rust, Swift, C++ and many others, really doesn’t use any GC, neither managed nor reference counting based.

Reference counting is a form of GC. Saying Swift, or Perl, are not GC’ed would be misleading.

In Rust, reference counting is opt-in for individual objects. It is a necessity for any powerful, low-level language to be able to implement any high-level feature.

You can, after all, also implement reference counting in C.

To avoid GC, you need a language where it’s opt-in. For example C++ or Zig, but not OCaml.