Transpiler AST Subtree Variable Replacement

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In cloud computing environments, the transpilation of source code into output code often results in excessively long and complex output, leading to increased processing time, memory usage, and data transfer requirements, which hampers efficiency in distributed systems.

Innovation Solution

An optimizing transpiler system that traverses the abstract syntax tree of the input source code, identifies reusable sub-trees, and replaces them with variables, generating more concise and efficient output source code, specifically optimized for languages like JavaScript, to improve performance and reduce data transfer.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Length of moving object

If conventional transpilation is used, then source code is transformed into output code, but the output code becomes excessively long and complex

Engineering Contradiction:
Improveoutput code lengthVSAvoidcode complexity
Core Design Contradiction:
Length of moving objectVSDevice complexity

Solution Approach 1:

The patent segments the abstract syntax tree into reusable sub-trees and replaces them with variables. This segmentation approach breaks down the complex transpilation process into manageable parts, allowing the system to identify and replace repeating patterns, thereby reducing output code length and complexity while maintaining functional equivalence

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent merges identical or equivalent sub-trees in the abstract syntax tree by replacing them with a single variable reference. This merging technique consolidates redundant code structures, eliminating repetition and reducing the overall size of the generated output code while preserving the original functionality

Inventive Principle:
Principle #5Merging (Combining)

2Productivity

If conventional transpilation is used, then source code is transformed into output code, but processing time increases

Engineering Contradiction:
Improvetranspilation speedVSAvoidprocessing time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent performs preliminary analysis of the abstract syntax tree to identify reusable sub-trees before generating the final output code. This preliminary action allows the system to prepare optimization patterns in advance, enabling faster transpilation by avoiding redundant code generation and reducing the overall processing time

Inventive Principle:
Principle #10Preliminary action

3Quantity of substance

If conventional transpilation is used, then source code is transformed into output code, but data transfer requirements increase

Engineering Contradiction:
Improvedata transfer volumeVSAvoidenergy consumption
Core Design Contradiction:
Quantity of substanceVSLoss of energy

Solution Approach 1:

The patent extracts and removes redundant code patterns from the transpilation output by replacing them with variable references. This extraction technique eliminates unnecessary data transfer by reducing the volume of code that needs to be transmitted, thereby lowering energy consumption associated with data transfer in distributed systems

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS11068244B2Optimized transpilation
Publication Date: 2021.07.20 SALESFORCE INC
  • US11068244B2 patent drawing
  • US11068244B2 patent drawing
  • US11068244B2 patent drawing

AI summary

System and methods are described to parse input source code and generate a tree representing the input source code, optimize the tree by determining reusable sub-trees of the tree and replacing the reusable sub-trees with variables, and transpile the optimized tree to generate output source code.