|
|
|
|
|
by adrianratnapala
3537 days ago
|
|
There is an advantage to universal GC: it can simplify interfaces. For example, in C every time a `const char *` appears in an API there has to be an implicit contract about who owns the string and how to free it. A language like Rust improves on this by enforcing such contracts, but the contracts still complicate every interface. In a GC'd language you can just forget about these issues and just treat strings (and other immutable objects) almost as if they were ordinary fixed-sized values. |
|
Put very simply: do your choice for your problem and deal with its consequences.