Source Code Translation via Intermediate Representation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Manual translation of source code from legacy platforms to modern cloud-based systems is complex, time-consuming, and error-prone, especially when migrating ETL code, requiring significant human intervention and leading to inconsistencies due to different coding styles and logic.

Innovation Solution

A system and method for automatically translating source code by parsing input code into an intermediate representation based on an abstraction model, optimizing it, and formatting it into output code compatible with a target platform, reducing the need for manual translation and minimizing human intervention.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If manual translation of source code is performed by skilled developers, then the translation can be completed with knowledge of both source and target vendor systems, but the process becomes complex, time-consuming, resource intensive, and error-prone due to multiple developers applying different coding styles and logic

Engineering Contradiction:
Improvetranslation accuracyVSAvoidtranslation time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent introduces an intermediate representation (IR) as a mediator between source code and target code. The source code is first translated into an IR format that captures the semantic meaning and structure, which then serves as a platform-independent intermediate form that can be systematically transformed into various target languages. This intermediary step standardizes the translation process and eliminates variability introduced by different developers' coding styles.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The translation process is segmented into distinct phases: source code parsing into IR, IR optimization, and IR transformation to target code. Each phase is handled by specialized components (parsers, optimizers, code generators) that can be independently developed and maintained. This segmentation allows for more reliable and maintainable translation systems while reducing the time required for complete translation tasks.

Inventive Principle:
Principle #1Segmentation

2Adaptability or versatility

If manual translation is performed to handle multiple source ETL formats and translate them to target ETL formats, then comprehensive translation capability is achieved, but the complexity increases significantly requiring collaboration between many skilled developers

Engineering Contradiction:
Improvetranslation capabilityVSAvoidsystem complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The intermediate representation serves as a universal format that can represent multiple source ETL formats and translate to multiple target ETL formats through a single unified system. The IR captures the essential semantic structure of ETL operations in a platform-independent manner, allowing the same IR to be transformed into various target languages (SQL, Python, Java, etc.) without requiring separate translation paths for each source-target combination.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The IR acts as a universal intermediary that decouples source format complexity from target format requirements. By translating all source formats into this common intermediate form first, the system manages complexity centrally in the IR definition rather than distributing it across multiple developer-specific translation rules, thereby achieving versatility without proportional increases in system complexity.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Ease of manufacture

If lift-and-shift migration is used to replicate source application exactly on target cloud platform, then cost-effectiveness is achieved, but the migrated application does not optimize to take full advantage of the new cloud environment

Engineering Contradiction:
Improvemigration costVSAvoidapplication performance
Core Design Contradiction:
Ease of manufactureVSProductivity

Solution Approach 1:

The system transforms the application code by changing its structural parameters to match the target cloud platform's optimal execution model. The IR representation allows for optimization passes that restructure queries, adjust data access patterns, and modify computational logic to leverage cloud-specific features such as distributed computing, parallel processing, and cloud-native data formats, thereby improving performance without requiring complete manual rewriting.

Inventive Principle:
Principle #35Parameter changes

4Productivity

If complete rewriting of data pipeline is performed into target vendor system codebase, then optimization for target system is achieved, but manual translation requires significant human intervention and introduces inconsistencies

Engineering Contradiction:
Improveapplication performanceVSAvoidtranslation consistency
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The intermediate representation serves as a consistent intermediary that ensures translation consistency across different target platforms. By translating to IR first using standardized parsing rules, then from IR to target code using platform-specific code generators, the system maintains reliability through centralized semantic validation in the IR phase while allowing each target generator to optimize for its specific platform without introducing inconsistencies.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS20230280990A1System and method for source code translation using an intermediate language
Publication Date: 2023.09.07 NEXT PATHWAY INC
  • US20230280990A1 patent drawing
  • US20230280990A1 patent drawing
  • US20230280990A1 patent drawing

AI summary

A system and method for migrating data management code converts input source code compatible with a source platform to output source code compatible with a target platform. The source code is parsed to generate an intermediate representation of the input source code based on an abstraction model. The abstraction model is structured to include one or more workflows, with each workflow including data manipulation units and/or execution plans for controlling the execution of activities contained therein. The intermediate representation is formatted into the output source code. The output source code may be packaged for deployment on the selected one of the one or more target platforms.