Automated Inter-Language Interface Generation for Legacy Code
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for allowing newer programming languages to access functions from legacy languages are labor-intensive and require significant manual effort, as they often necessitate rewriting legacy files or creating language-specific interfaces, which is inefficient and time-consuming.
Innovation Solution
An automated inter-language interface generation method that marks legacy file headers to define function exposure and parameter usage in an object-oriented architecture, allowing for the creation of a wrapper that enables access to legacy files from multiple target languages without manual wrapping, using a graphical user interface for input and generating documentation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Extent of automation
If an interface generation application like SWIG is used to automatically generate wrapper functions, then interface generation is automated, but the generated code is difficult for developers to use and requires substantial manual hand-wrapping effort
Solution Approach 1:
The patent introduces an intermediary processing layer that automatically generates both the wrapper functions and the corresponding interface documentation in a coordinated manner. This mediator system translates between the legacy language interface and target language requirements, producing ready-to-use code without requiring manual hand-wrapping, thus resolving the contradiction between automation and usability
Solution Approach 2:
The patent segments the interface generation process into distinct, automated components: header analysis, wrapper function generation, and documentation generation. Each component handles a specific aspect of the translation process, allowing the system to produce complete, usable interfaces automatically without requiring developer intervention for hand-wrapping
2Adaptability or versatility
If legacy executable files are rewritten in newer languages to provide the same functions, then language compatibility is improved, but significant time and expense are required for recreation and validation
Solution Approach 1:
The patent creates a virtual copy of the legacy language interface through automatically generated wrapper functions that replicate the original functionality in the target language. This copying approach preserves the original legacy code unchanged while providing language-compatible access points, eliminating the time-consuming process of rewriting and validating legacy functions in new languages
Solution Approach 2:
The patent performs preliminary analysis of the legacy language header files to automatically generate the necessary wrapper functions and interface definitions before any target language implementation. This preliminary action establishes the compatibility layer in advance, preventing the need for time-consuming recreation and validation of legacy functions
3Adaptability or versatility
If language-specific interface generation applications are used (e.g., Boost for Python, JNI for Java), then access to legacy files is enabled for specific target languages, but a different interface must be generated for each target language
Solution Approach 1:
The patent creates a universal interface generation system that can generate wrappers for multiple target languages from a single legacy language header file. This multi-functional system eliminates the need for separate language-specific tools by implementing a general-purpose generator that adapts to different target languages through configuration, reducing the complexity of generating multiple language-specific interfaces
Data Source
AI summary
An inter-language interface is created for an executable file written in a legacy language. The header associated with the legacy file is initially marked up language to generate a first marked header. The legacy file is then wrapped with a first wrapper based at least partially upon the first marked header to create a first wrapped file. Additionally, the first marked header is associated with type maps customized in accordance with the target language in order to generate a second marked header. An executable file may then be generated by wrapping the first wrapped file with a second wrapper so as to be executable in the target language, thereby creating a second wrapped file. Additionally, an interface layer is generated to associate functions in the legacy language with methods in the target language and to define the usage in the target language of the parameters in the legacy language.


