Lazy Analysis |
When the
Analysis happens later, and only where you goWhen running in the lazy analysis mode, gbeta only obtains static information, such as the type of a declared name, at the time when it is first needed. This means e.g. that you can go through a session which only uses a small part of a big program (perhaps because it includes a lot of libraries), and only that small part of the program will be analyzed statically. The rest of the program may have all kinds of flaws (except bad syntax), and it will not be discovered, but on the other hand you get a much faster startup process. Fewer things are checkedNot only unused parts of a program are not analyzed. Several other aspects of static analysis are not needed in order to choose the semantically correct actions to take during execution. For example, the number and type of arguments given in a method call are not checked statically in lazy analysis mode. This means that an invocation which e.g. gives a wrong number of arguments in a method call will give rise to a run-time error in stead of a (err .. also run-time, since it is late) type-checking error. As an example, the program:
|