[Improvement]: Remove unnecessary type definition creation for interop function definitions #40914
Labels
Priority/High
Team/CompilerFE
All issues related to Language implementation and Compiler, this exclude run times.
Type/Improvement
Milestone
Description
$title
If an interop function is defined in Ballerina it creates unnecessary type definitions by the front-end per each interop function.
For example, langlibs have high no. of interop functions. (eg: float langlib nearly 35 and it has 70 BLangTypeDefinitions in the BLangPackage - 2 per one interop function).
Hence we have high no. of unnecessary typedesc classes, value classes, frame classes that result in unnecessarily large jar size.
Describe your problem(s)
E.g.:
For the first 2 interop functions, the front-end creates records {class:.., name:..} and 2 type definitions for each interop function.
Describe your solution(s)
We see the type definitions created for all interop functions are mostly the same. We can try removing all of them or keep at most just 2, thus removing unnecessary typeDefs and attached functions in the BIRPackage.
Related area
-> Compilation
Related issue(s) (optional)
#40867
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: