Design of Tuple type #203
Replies: 3 comments 2 replies
-
Similar to Record type and Array type, we can model the Tuple Type object in the Rust side in the runtime and use opaque pointer on the LLVM codegen. Similar to Array and Record, we have to implement Operations like store and load and pass the required information from Codegen side to Rust side. Same as Array type, we have to implement init function for this Tuple Type. We need to pass Tuple type information as parameters like Tuple field order. We have to implement Load and Store API's like Array and we have to call these runtime rust functions from LLVM codegen side with required information. Please give your suggestions. |
Beta Was this translation helpful? Give feedback.
-
@ramakotareddy, I think the tuple type is a bit different from the array type or map type. I like to point you to a couple of features of tuple type, which need to be considered when designing. Please consider the below example.
For more examples please read https://ballerina.io/learn/by-example/tuple-type.html |
Beta Was this translation helpful? Give feedback.
-
simple tuple test case:public function main() { BIR:public main function() -> () {
} -> Here, "%1 = newArray (int, string)[%3];" initializing as a array. |
Beta Was this translation helpful? Give feedback.
-
Design proposal Tuple type #172
Beta Was this translation helpful? Give feedback.
All reactions