Dynamic Object Platform Portable Code
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Statically compiled languages face challenges in creating platform portable code due to errors detected by compilers and load time verification systems when including platform-specific instructions, as they typically generate platform-specific binaries and flag code for other platforms as errors.
Innovation Solution
Declaring objects as dynamic in a program compiled using a static language excludes them from static analysis, allowing dependent calls to platform-specific APIs, which are then loaded and tested at runtime to prevent errors, enabling execution on multiple platforms with platform-specific APIs.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If multiple versions of platform-specific instructions are included in source code using #ifdef, then the program can execute on different platforms, but the compiler generates multiple compiled binaries and flags code for unsupported platforms as errors
Solution Approach 1:
The patent segments platform-specific code into separate dynamic libraries that can be loaded independently at runtime. Instead of compiling all platform-specific code into multiple binaries, the code is divided into modular components that are only loaded when needed, reducing the number of compiled binaries while maintaining platform adaptability.
Solution Approach 2:
The patent uses dynamic code loading and verification mechanisms that allow the program to adapt its behavior at runtime based on the target platform. The compiler generates a single binary that dynamically loads appropriate platform-specific code, transitioning from static compilation to dynamic adaptation, thereby reducing binary complexity while preserving versatility.
2Reliability
If a platform adaptation layer (PAL) is implemented using object oriented inheritance, then errors from inappropriate API calls are prevented, but the implementation becomes complicated requiring careful inheritance management and library deployment
Solution Approach 1:
The patent introduces a dynamic verification mechanism that acts as an intermediary between the compiled code and platform-specific APIs. This verifier checks API compatibility at runtime without requiring complex inheritance hierarchies or manual PAL implementation, thereby maintaining reliability while reducing implementation complexity.
Solution Approach 2:
The system implements automatic platform detection and code verification that performs error prevention tasks without requiring manual intervention. The dynamic verifier automatically checks compatibility and prevents inappropriate API calls, eliminating the need for complex inheritance management and manual library deployment while maintaining high reliability.
3Measurement precision
If static analysis is performed on all objects during compilation, then programming errors are detected at compile time, but platform-specific code for unsupported platforms is flagged as errors
Solution Approach 1:
The patent extracts platform-specific code into separate dynamic libraries that are excluded from static analysis during compilation. The compiler performs static verification on the core program while platform-specific code is loaded dynamically at runtime, allowing error detection for critical code while preserving platform portability for adaptive code.
Solution Approach 2:
The patent transitions from static analysis of all code to a hybrid approach where static verification is applied to platform-independent code while platform-specific code undergoes dynamic verification at runtime. This dynamic approach allows the system to maintain high error detection accuracy for critical code while preserving adaptability for platform-specific implementations.
Data Source
AI summary
Creating and executing platform portable code. A method includes declaring an object as being a dynamic object in a program. The program is a program compiled using a static language, except that the dynamic object is excluded from static analysis on the object when the program is compiled. The dynamic object includes a dependent call to a platform specific API. The platform specific API is available on one or more platforms to which a compiled version of the program will be deployed, but not available on one or more other platforms to which the compiled version of the program will be deployed.


