Dynamic lazy type system
AssigneeMicrosoft Technology Licensing, LLC
InventorsErik Christensen, Michael Coulson, Clemens Szyperski, Gregory Hughes
Life of this patent
Estimating the term…
Abstract
A dynamic, lazy type system is provided for a dynamic, lazy programming language. Consequently, programs can benefit from runtime flexibility and lightweight notation in combination with benefits afforded by a substantial type system.
Claims26
A system, comprising:
- a processor coupled to a memory, the processor configured to perform component execution, namely, configured to execute at least one computer-executable component which is stored in the memory;
- a type system having a plurality of types, wherein type enforcement using a constraint is performed at runtime;
- and
- an analysis component configured to analyze a value and a type which defines allowable values, in order to determine if the constraint provided by the type holds, wherein at least one allowable value is specified using a “where” clause;
- and
- an assignment component configured to automatically identify the type for the value during runtime.
A method, comprising:
- employing at least one processor configured to execute computer-executable instructions stored in memory to perform the following acts during a runtime of an application program:
- analyzing (i) a value and (ii) a type which defines allowable values, thereby determining whether a constraint provided by the type holds;
- in response to determining the constraint provided by the type holds, automatically inferring the type;
- and
- in response to determining the constraint provided by the type is not satisfied, producing an error during the application program runtime;
- wherein the method comprises at least two of the following performed during the application program runtime:
- assigning types to computed values in the application program;
- determining whether the constraint is satisfied when a function is called in the application program;
- employing at least one type flow function to infer or compute a predicted result type of an application program function based on argument types in a call to the application program function;
- evaluating at least one allowable value against at least a portion of the type.
A computer-readable storage medium having instructions stored thereon that enables at least one processor to perform the following acts:
- lazily analyzing (i) a value and (ii) a type which defines allowable values, thereby determining whether a constraint provided by the type holds;
- and
- identifying the type for the value during an application program runtime in response to determining that the constraint holds;
- wherein the acts further comprise at least one of the following performed during the application program runtime:
- determining whether the constraint is satisfied when a function is called in the application program;
- employing at least one type flow function to infer or compute a predicted result type of an application program function based on argument types in a call to the application program function.
A system, comprising:
- a processor coupled to a memory, the processor configured to perform component execution, namely, configured to execute at least one computer-executable component which is stored in the memory;
- a type system having a plurality of types, wherein type enforcement using a constraint is performed at runtime;
- and
- an analysis component configured to analyze a value and a type which defines allowable values, in order to determine if the constraint provided by the type holds;
- and
- an assignment component configured to automatically identify the type for the value during runtime;
- wherein the system is configured to employ at least one type flow function to infer or compute a predicted result type of an application program function based on actual argument types in a call to the application program function, as opposed to declared parameter types.
A method, comprising:
- employing at least one processor configured to execute computer-executable instructions stored in memory to perform the following acts during a runtime of an application program:
- analyzing (i) a value and (ii) a type which defines allowable values, thereby determining whether a constraint provided by the type holds;
- in response to determining the constraint provided by the type holds, automatically inferring the type;
- and
- in response to determining the constraint provided by the type is not satisfied, producing an error during the application program runtime;
- wherein the method is further characterized in that at least one allowable value is specified using a “where” clause in the application program.
A computer-readable storage medium having instructions stored thereon that enables at least one processor to perform the following acts:
- lazily analyzing (i) a value and (ii) a type which defines allowable values, thereby determining whether a constraint provided by the type holds;
- and
- identifying the type for the value during an application program runtime in response to determining that the constraint holds;
- and
- wherein the acts further comprise at least one of the following performed during the application program runtime:
- determining that the value is within allowable values specified by a predicate in the application program;
- determining that the value is within allowable values specified using a “where” clause in the application program.
Dependencies are inferred from the claim text.