A system, comprising: at least one processor and a memory; a first component, that when executed by the at least one processor, performs a static analysis of an intermediate language code of a program having at least one dynamic feature, the static analysis comprising statically tracing a flow of execution of the program to determine which program elements are used in the program, wherein statically tracing comprises discovering each dependency needed by an instruction reachable from a root to execute and discovering uses in the program of each dependency, and associates at least one program element of the program with at least one of a plurality of confidence indicators, the plurality of confidence indicators including a high confidence indicator and a low confidence indicator, the high confidence indicator designating a program element as having a high likelihood of being used when the program executes and the low confidence indicator designating a program element as having a low likelihood of being used when the program executes, wherein associating at least one program element of the program with at least one of a plurality of confidence indicators comprises classifying each type and type members encountered during the static trace with one of a plurality of confidence indicators based on employing metadata of an assembly file associated with the intermediate language code and on a runtime description file , wherein the metadata and the runtime description file are generated by a language compiler generating the intermediate language code, wherein the dynamic feature includes one or more of reflection, late binding, and instantiation of generic types; and a second component, that when executed by the at least one processor, generates optimized native code from the intermediate language code based on the at least one confidence indicator. at least one processor and a memory; a first component, that when executed by the at least one processor, performs a static analysis of an intermediate language code of a program having at least one dynamic feature, the static analysis comprising statically tracing a flow of execution of the program to determine which program elements are used in the program, wherein statically tracing comprises discovering each dependency needed by an instruction reachable from a root to execute and discovering uses in the program of each dependency, and associates at least one program element of the program with at least one of a plurality of confidence indicators, the plurality of confidence indicators including a high confidence indicator and a low confidence indicator, the high confidence indicator designating a program element as having a high likelihood of being used when the program executes and the low confidence indicator designating a program element as having a low likelihood of being used when the program executes, wherein associating at least one program element of the program with at least one of a plurality of confidence indicators comprises classifying each type and type members encountered during the static trace with one of a plurality of confidence indicators based on employing metadata of an assembly file associated with the intermediate language code and on a runtime description file , wherein the metadata and the runtime description file are generated by a language compiler generating the intermediate language code, wherein the dynamic feature includes one or more of reflection, late binding, and instantiation of generic types; and a second component, that when executed by the at least one processor, generates optimized native code from the intermediate language code based on the at least one confidence indicator. <EOS>