HOME

TheInfoList



OR:

In programming languages, type erasure is the load-time process by which explicit type annotations are removed from a program, before it is executed at run-time.
Operational semantics Operational semantics is a category of formal programming language semantics in which certain desired properties of a program, such as correctness, safety or security, are verified by constructing proofs from logical statements about its exec ...
not requiring programs to be accompanied by types are named ''type-erasure semantics'', in contrast with ''type-passing semantics''. Type-erasure semantics is an abstraction principle, ensuring that the run-time execution of a program doesn't depend on type information. In the context of generic programming, the opposite of type erasure is named reification.


Type inference

The reverse operation is named
type inference Type inference, sometimes called type reconstruction, refers to the automatic detection of the type of an expression in a formal language. These include programming languages and mathematical type systems, but also natural languages in some bran ...
. Though type erasure can be an easy way to define typing over implicitly typed languages (an implicitly typed term is well-typed
if and only if In logic and related fields such as mathematics and philosophy, "if and only if" (often shortened as "iff") is paraphrased by the biconditional, a logical connective between statements. The biconditional is true in two cases, where either bo ...
it is the erasure of a well-typed explicitly typed lambda term), it doesn't provide
Rule of inference Rules of inference are ways of deriving conclusions from premises. They are integral parts of formal logic, serving as norms of the Logical form, logical structure of Validity (logic), valid arguments. If an argument with true premises follows a ...
for this definition.


See also

* Template (C++) * Problems with type erasure (in Generics in Java) * Monomorphization * Type polymorphism


References

* Type theory {{comp-sci-stub