Systems and methods for converting typed code
Abstract
Techniques provided implement automatic data type annotation in dynamically-typed source code. A codebase, which may comprise a plurality of source code files, is scanned at a global level. The resulting scanned data may describe characteristics of the codebase, including variable and function usage. Based on inferences drawn from the scanning, data types are determined for different variables, expressions, or functions to facilitate conversion from dynamically-typed source code to statically-typed source code. For example, if a function is called once with a parameter value of data type A (e.g., class A), and another time with a parameter value of data type B (e.g., class B), a conversion tool may annotate the parameter variable in the declaration of the function with a data type D (e.g., class d) when data type D is identified as a common ancestor (e.g., superclass) to both data type A and data type B.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 21 · Forward citations: 2.
Claims (1 — 1 Independent, 0 Dependent)
- Claim 1Independent Claim
A computer-implemented method comprising: scanning, by a computer system, a codebase to determine a first set of characteristics associated with a first dynamically-typed variable or function in the codebase; determining, by the computer system, a first set of potential data types for the first dynamically-typed variable or function based on the first set of characteristics; determining, by the computer system, a first candidate data type that is a superclass of data types associated with the first set of characteristics, and wherein each of the data types associated with the first set of char
Technical Overview & Description
Full multi-page specification text is archived at the issuing office. Read complete official specification ↗
Cited By — Indexed Forward Citations (2 of 2 total)
References Cited — Backward Prior Art (21)
Non-Patent Literature (5)
- Burke, Michael G. et al., "The Jalapefio Dynamic Optimizing Compiler for Java," 1999, pp. 129-141.
- Engler, Dawson R. et al., "DCG: An Efficient, Retargetable Dynamic Code Generation System," 1994, pp. 263-272.
- Furr, Michael, "Combining Static and Dynamic Typing in Ruby," PhD dissertation, Department of Computer Science, University of Maryland, 2009, pp. 90-135.
- Guo, Philip J. et al., "Dynamic Inference of Abstract Types," 2006, pp. 255-265.
- Haldiman, Niklaus, et al., "Practical, Pluggable Types for a Dynamic Language," Computer Languages, Systems & Structures, vol. 35, No. 1, Apr. 2009, pp. 48-62.