With run time linguistic reflection, supported in PS-algol and Napier88, the generators are evaluated during program execution and the new code produced is compiled and executed in the same context. Both forms of linguistic reflection have the effect of blurring the distinction between compile time and run time. One application of linguistic reflection is in supporting evolution in strongly typed persistent systems. Given some mechanism for locating the relevant programs and data, linguistic reflection can be used to introduce transformed versions in a controlled manner. Another application is in providing highly generic programs.
Polymorphism is one powerful mechanism for genericity.
There exist, however, some generic computations which are hard or impossible to express using parametric or inclusion polymorphism. The difficulty lies in the fact that the course of such a computation depends on details of the types of the input parameters, while parametric and inclusion polymorphism by their nature abstract such details away. A well used example is that of a strongly typed natural join function, where the algorithm and the type of the result relation depend on the types of the input relations. This can be implemented using linguistic reflection, by defining a generator procedure which accepts representations of the types of the relations to be joined and generates the representation of a procedure to perform the join for those types. This mechanism has some similarities with that of 4GL systems, where generic application descriptions are automatically tailored to specific instances.