Open heshanpadmasiri opened 11 months ago
I am planning to this in fallowing stages
BIRFunction
and make user defined closures use the nested functions.Given current jBallerina implementation don't have a correctness problem, these changes are purely a potential performance improvement (mainly in the domain of garbage collection). Since closures are not prevalent in typical ballerina programs we have decided to temporarily pause work on this. #41769 implements 1 and 2. For 3 we need to move basic type values in to heap and make each closure map pointers to those values. One way to do that would be to introduce wrapper classes for basic types similar to Ref
in Kotlin
Description
Main purposed changes are to introduce nested functions to jBallerina BIR and avoid lifting nested functions to the module scope as part of desugaring process.
Describe your task(s)
No response
Related area
-> Compilation
Related issue(s) (optional)
Relevant issues in nBallerina
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response