Difference between revisions of "Type inference"

From Liberty Eiffel Wiki
Jump to navigation Jump to search
m (8 revisions: initial import from SamrtEiffel Wiki - The Grand SmartEiffel Book)
 
m
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  +
Type inference is an algorithm allowing Liberty Eiffel to statically compute (at compile time) the true type of objects at run time.
[[Category:Book]]
 
   
  +
Usually, this algorithm allows simplifying the generated code by deleting [[dynamic binding]] sites when the static type is computed to be reduced to a unique dynamic type. This simplification is summed up and displayed by the [[compile|compiler]] when using the <TT>-verbose</TT> flag. It's called ''type inference score''; it is the fraction of simplified binding sites over the total number of sites.
Type inference is an algorithm allowing SmartEiffel to statically compute the true type of the objects at run time.
 
 
Usually this algorithm allows to simplify the generated code by deleting [[dynamic binding]] sites when the static type is computed to be reduced to a unic dynamic type. This simplification is summed up and displayed by the [[compile|compiler]] when using the <TT>-verbose</TT> flag. It's called ''type inference score''; it is the fraction of simplified binding sites over the total number of sites.
 
   
 
One should note that a 100% score is usually not possible, nor desirable; else your project is not really written in an OO spirit...
 
One should note that a 100% score is usually not possible, nor desirable; else your project is not really written in an OO spirit...

Latest revision as of 23:18, 21 December 2021

Type inference is an algorithm allowing Liberty Eiffel to statically compute (at compile time) the true type of objects at run time.

Usually, this algorithm allows simplifying the generated code by deleting dynamic binding sites when the static type is computed to be reduced to a unique dynamic type. This simplification is summed up and displayed by the compiler when using the -verbose flag. It's called type inference score; it is the fraction of simplified binding sites over the total number of sites.

One should note that a 100% score is usually not possible, nor desirable; else your project is not really written in an OO spirit...