why java compiler is not more smart.
Suppose it is, then it can find out the unreachable object at compiletime and code itself clean the garbage. I`m thinking that this will helps to avoid garbage collection concept in java(need to add DELETE keyword for delete the object). Why it is not possible?..
why java compiler is not more smart. Suppose it is, then it can find
Share
There is a lot of problems computers can’t always give a yes or no answer to. Actually, there is more problems which can’t be solved by computers than problems which can.
Look at Undecidable problem and List of undecidable problems. There you will find the halting problem: Halting problem which says that a computer can’t even say whether or not a program stops. If you could construct a compiler as you describe, then this wouldn’t be a problem – so you can’t (it can be proved).
Furthermore, there is a theorem which says you NEVER can make an optimal compiler 😉 they can always be improved 🙂