| ▲ | tcfhgj 4 days ago |
| Maybe you are not giving that up, but you are giving up doing memory management "properly", i.e. use more memory and CPU time than necessary for convenience. |
|
| ▲ | nromiun 4 days ago | parent [-] |
| Like writing only in assembly is "proper" programming? Using more memory and CPU time than necessary for convenience? |
| |
| ▲ | tcfhgj 4 days ago | parent [-] | | systems programming languages compile right down to machine code | | |
| ▲ | nromiun 4 days ago | parent [-] | | Both borrow checker and GC use malloc/free internally as well. According to you there is no difference between the two. | | |
| ▲ | tcfhgj 4 days ago | parent [-] | | yes, there is: GC will not use stack allocation and it will add another layer of memory management resulting in significant memory overhead (runtime overhead) | | |
| ▲ | nromiun 4 days ago | parent [-] | | Of course they do. For example C#, D, Nim etc all use stack allocation with their GC. Not to mention Rust also allocates dynamic objects on the heap. So not sure what is your point. | | |
| ▲ | tcfhgj 3 days ago | parent [-] | | The language may allow it, but it's not GC managed then. My point is runtime overhead.
In C# structs and their refs (including a simple borrow checker to detect invalid ref use) were introduced to escape GC management und reduce it's runtime impact on the programs |
|
|
|
|
|