Compiler Inferring Argument Attributes from Call Site
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional compilers rely on source code declarations and assertions to determine function argument attributes, limiting code portability and efficiency, as they cannot infer attributes from external information passed during compilation.
Innovation Solution
Compilers are designed to infer function argument attributes from information passed during compilation, such as examples, objects, and assertions, allowing for the removal of attribute declarations from the source code, enabling the compilation of polymorphic functions into reduced polymorphic forms with static and dynamic attributes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If source code includes declarations and assertions to provide compiler with attribute information, then the compiler can accurately determine function argument attributes, but the source code becomes less portable and more complex
Solution Approach 1:
The patent extracts attribute information (declarations and assertions) from the source code and moves it to external configuration files or metadata. This allows the compiler to obtain attribute information without it being embedded in the source code, thereby improving portability while maintaining accurate attribute determination.
Solution Approach 2:
The patent introduces an intermediary layer (external configuration files, metadata, or attribute databases) that mediates between the source code and the compiler. This intermediary contains the attribute information, allowing the compiler to query it without the source code needing to include declarations and assertions, thus resolving the contradiction between accuracy and portability.
2Reliability
If source code includes declarations and assertions for attribute information, then the compiler can compile the code, but the compilation process becomes less efficient and more time-consuming
Solution Approach 1:
The patent performs preliminary extraction and organization of attribute information into external configuration files or metadata before the compilation process. This preliminary action allows the compiler to quickly access pre-processed attribute information rather than parsing declarations and assertions from source code during compilation, thereby improving compilation efficiency while maintaining correctness.
Solution Approach 2:
The intermediary layer (external configuration files or metadata) serves as a pre-prepared repository of attribute information. The compiler queries this intermediary during compilation rather than analyzing source code declarations, which speeds up the compilation process while ensuring accurate attribute determination for correct compilation.
3Measurement precision
If attribute information is embedded in source code, then the compiler can determine function argument attributes, but the compiler cannot infer attributes from external information passed during compilation
Solution Approach 1:
The patent introduces an intermediary system that connects the compiler with external information sources (configuration files, metadata, attribute databases). This intermediary enables the compiler to automatically infer attribute information from external sources passed during compilation, eliminating the need for attribute information to be embedded in the source code while maintaining precise attribute determination.
Solution Approach 2:
The patent implements a feedback mechanism where the compiler can query external information sources during the compilation process. The external sources provide attribute information in response to compiler queries, enabling automatic attribute inference without requiring declarations in the source code, thus improving both automation and attribute information availability.
Data Source
AI summary
Disclosed herein are methods and compilers for compiling code. The methods and compilers disclosed can compile a callable compilable unit of code free of declarations and assertions that identify attributes of arguments expressed therein. The attributes of the arguments in the callable compilable unit of code are inferred by the compilers and methods disclosed herein from information provided by a call site that calls a compiler to compile the callable compilable unit of code.


