Is garbage detection a thing?

Mark was330 at via.tokyo.jp
Sun Nov 29 22:24:50 UTC 2020


> The reason this distinction is important, and the reason I 
> bring up graph theory, is that liveness is impossible to prove.
>  Seriously: it's impossible, in the general case, for the GC to 
> prove that an object is still alive.  Whereas it's trivial to 
> prove reachability.

My motivation was actually just that I wanted a very small 
compiler with no libraries, because I got a bit tired of big 
things with little defects.

But the liveness is a thing I would like to say something about: 
I don't want a compiler that tries to prove it for me. The reason 
is that if I did manual memory management and created a 
use-after-free bug, then my personal world would be still very 
good. It's just that the industry isn't happy when releasing 
banana software is a serious problem?

In the case of the use-after-free I would say that my software 
needs correct memory state and correct logic. The logic so to 
speak is what I actually wanted to implement in the first place. 
If the program is perfect and works in all situations, how could 
it do this with bugs in the memory management? It can't.

So, I didn't really think often about it, but when Rust came out, 
there was some trend into this direction, and my feeling was: I 
can follow it, it looks good, but can I still just use C? The way 
it works would just be that I have correct out-of-bounds and 
use-after-free/double-free detection and race condition detection 
if my software is supposed to be chaotic server or browser 
software (?), both things at runtime. Given that it is true (?) 
that software cannot do a task correctly when it does part of it 
(memory management) incorrectly.

More or less it was an idea to get what Rust and Swift try to do 
without all the language features. C with less language 
constructs would be nice. It's just that the processors are bad 
for me, for what I'm trying to do. Intel offers MPX. It's good I 
guess. But why does Visual C++ implement it like an easter egg. 
Why have they now added ASAN as experimental feature that 
immediately fails. They do things I don't really like, because 
the industry needs it like this, but not me. And at the high 
level, there's bloat and fancy colors.

I want just a toolkit to create exactly what can be created, and 
if I do it wrong it should fail hard. And I'm trying to make it 
so that I don't write assembly, if that is possible and good in 
my situation.

I'd say, I have just not understood the whole thing and maybe 
should try a different hobby, or finally create the thing I'm 
looking for, which turns out to be an endless story. It's just 
that a few hours ago I had the hope that the holy grail would 
exist.

I had found the solution to almost every problem in Golang. And 
then after one year my hobby just broke down, because Go outputs 
wrong line numbers. It's no good compiler when it does that. I'd 
rather quit my hobby than accept it.

Thanks a lot for your explanation!
Really kind regards,
you helped me to understand it.


More information about the Digitalmars-d-learn mailing list