Compiler with user-defined type inference rules
Abstract
Performance of a program written in dynamic languages is improved through the use of a compiler that provides type inference for methods having a user-defined element. The user-defined element may be an input in a user-defined type. Though, the user-defined element may reflect that the method is user-defined. Type inference may be performed based on a user-defined mapping, relating input types to output types for one or more methods. The mapping may be specified as a data table provided to the compiler or as one or more functions that register with the compiler such that, as the compiler processes portions of a source program and detects a method with a user-defined element, the compiler may access the mapping and infer the type of an output of the method. The inferred type may then be used to optimize code dependent on that output.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 13 · Forward citations: 2.
Claims (1 — 1 Independent, 0 Dependent)
- Claim 1Independent Claim
A computer-implemented method, the computer-implemented method comprising: compiling a source program associated with a dynamic language, the source program having a plurality of predefined types, a plurality of user-defined types, and a plurality of methods, each method accepting input values and producing output values, the output values of a predefined type or a user-defined type; during compilation, for each of a plurality of portions of the source program: determining whether the portion comprises a method involving implicit type inference; when the portion comprises a method involving im
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 (13)
Non-Patent Literature (5)
- MONC-A Matlab Language .NET Compiler-Retrieved Date: Apr. 15, 2010 http://www.monc.eu/Tech.aspx.
- Relaxed Dependency Analysis-Retrieved Date: Apr. 15, 2010 http://hackage.haskell.org/trac/haskell-prime/wiki/RelaxedDependencyAnalysis.
- The Necessity of Type Inference-Published Date: 2008 http://guidewiredevelopment.wordpress.com/2008/07/15/the-necessity-of-type-inference.
- Tony Stubblebine, "Regular Expressions for Perl, C, PHP, Python, Java, and .NET", 2007.
- Type Arithmetic-Retrieved Date: Apr. 15, 2010 http://okmij.org/ftp/Computation/type-arithmetics.html.