Compiler with type inference
AssigneeMicrosoft Technology Licensing, LLC
InventorsDarius Amir HODAEI, Triinu VIILUP
Life of this patent
Estimating the term…
Abstract
A compiler is described which has a processor configured to receive a computer program comprising a plurality of instructions, the instructions comprising one or more variables and context of the variables. The compiler has a type selector configured, upon evaluation of an instruction comprising a variable by the compiler, to infer a type of the variable using the context of the variable and dereference the variable using the inferred type.
Claims21
A compiler comprising:
- a processor configured to receive a computer program comprising instructions, the instructions comprising one or more variables and context of the one or more variables;
- a type selector for inferring, based at least on an evaluation of an instruction comprising a variable of the one or more variables by the compiler,
- a type of the variable using the context of the variable and dereference the variable using the inferred type;
- and
- a type inference component for carrying out a type check of the variable prior to execution of the computer program by accessing a recommended type of the variable from the instructions and terminate compilation of the computer program based at least on the recommended type being incompatible with types associated with the context of the variable.
(canceled)
A method of operation of a compiler comprising:
- receiving, at a processor, a computer program comprising instructions, the instructions comprising one or more variables and context of the one or more variables;
- evaluating at least one of the instructions comprising a variable and context of the variable, and, as part of the evaluation, inferring a type of the variable using the context of the variable and deference of the variable using the inferred type;
- and
- carrying out a type check of the variable prior to execution of the computer program by accessing a recommended type of the variable from the instructions and terminate compilation of the computer program based at least on the recommended type being incompatible with types associated with the context of the variable.
One or more computer-readable media with device-executable instructions that, when executed by a computing system, direct the computing system to perform operations comprising:
- receiving a computer program comprising instructions, the instructions comprising one or more variables and context of the variables;
- evaluating at least one of the instructions comprising a variable and context of the variable, and, as part of the evaluation, inferring a type of the variable using the context of the variable and deference of the variable using the inferred type;
- and
- carrying out a type check of the variable prior to execution of the computer program by accessing a recommended type of the variable from the instructions and terminate compilation of the computer program based at least on the recommended type being incompatible with types associated with the context of the variable.
Dependencies are inferred from the claim text.