4 ms·
> Since the compiler won't be helping you enforce the management of resources since, as you point out, it's out of scope, it introduces a new vector for error
by weberc2 8y ago
> Since the compiler won't be helping you enforce the management of resources since, as you point out, it's out of scope, it introduces a new vector for error
It's not a new vector of error; it's the same vector that C has to deal with.
> resource management has to be grafted on top of a GC memory model
Only if this means "don't bind resource lifetimes to memory lifetimes", which is the solution that every tracing GC language implementation (that I'm aware of) uses. There's nothing stopping you from refcounting file handles just like you would in C. The compiler could even automatically add in the refcounting instructions for you, or the language runtime could have a special GC just for file handles.
- arcticbull 8y agoSure but we're comparing it with Rust not C.