Monday, March 15, 2010

Some more thinking part 3 - or, the really I need to write it down thread!

We were discussing items like code which can be written by machines and such (in the last post). Note : this may necessarily not be true, it may be just a kick to get you linked to this page...Jokes apart. A machine can't know the code it will execute before it executes it, right? Or, better said, a machine can't know any code before it analyzes it. But, of course, we are talking about problem-solving in here, so why the heck would a program need to analyze a software (which actually handles the problem-solving by itself) to solve a specific problem? Back at you : how does the software know it solves the specific problem anyway? The answer is as simple and clear as you can (as most of the time you get it in Software engineering) get : it doesn't.
So what can you make out of it?
Consider : you have a machine, then you have a piece of code, which the machine has never executed before. How can the machine know what that same piece of code does, if not by executing it? Whilst the concept of virtualization comes to mind, that might not be a feasible solution to the problem, considering all the side-costs it brings with it; for an example, anti-virus software share the same type of issue, but address it at a higher level, by analyzing codebyte-patterns. A virtual machine would be way to costy.

On the other hand, even if a machine would analyze some code, it would still need to execute it (even if in a protected / virtual environment) to understand the effects of every single instruction.

It seems the answer is simple : there is no way for a machine to completely know what a source code does without executing it.

No comments: