-
|
Hello All, I've been looking to the possible options to implement the Ballerina Map type and would like to share my opinions for discussion here. Target features / requirementsI summarized the target feature set here [1] High level design
Concerns related to the limitations of C++/Rust interoperability
If our Runtime was to be written in C++, then we could use generics to simplify the interfaces and pass object references and get type checking safeties. Vice versa, it would also work better if both the compiler and runtime was in Rust. References:[1] : https://gist.github.com/ruvi-d/18c10fe382dc923fc3e0ebc32a6ee738 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
One more point. I am not entirely clear on the best approach to release memory that is allocated on the runtime side. I am hoping that Ayonam might have a recommendation. My initial thoughts are that this problem can be simplified with the use if smart pointers. Though we will need to have the compiler and runtime written in the same lang to support it. |
Beta Was this translation helpful? Give feedback.
-
Even in C++, we'll not be able to call template functions directly form generated code. We'll have to do manual template specialization using wrappers. It will be similar in rust as well. We might be able to automate it by writing a macro to generate it, in either case.
Ya, we'll not be able to leverage Rust's native safety advantage specially at the boundary (ie: layer that interface with generated code). But hopefully the deeper parts like stdlib/langlib will be benefited. We should localize all our |
Beta Was this translation helpful? Give feedback.
Even in C++, we'll not be able to call template functions directly form generated code. We'll have to do manual template specialization using wrappers. It will be similar in rust as well. We might be able to automate it by writing a macro to generate it, in either case.
Ya, we'll not be able to leverage Rust's native safety advantage specially at the boundary (ie: layer that interface with generated code). But hopefully the deeper parts like stdlib/langlib will be benefited. We should localize all our
unsafekeyword usages just to the runtime layer.