C++ interop #733
Replies: 0 comments 2 replies
-
We're planning on sticking to transpilation to drive our interop story for the time being. Note, however, that our primary goal with transpilation is pedagogical. We want to explain Val's semantics in terms of a language that's likely familiar to our target audience. There are some quite tricky challenges we'll have to overcome if we want to transcript Val's exact semantics to C++ and rely on this technique as a production-ready approach. Although both languages are closely related, they make a couple of fundamentally different choices w.r.t. move semantics, initialization, and destruction. Dealing with these differences will likely result in very strange C++ code, going against our educational goal. While we could use C++ as a kind of assembly language to compile Val, we'd have to build a whole compiler architecture for that. From that observation, using LLVM looks like a better option. That means that in the long term we'll likely need to link native Val and C++ code through foreign function interfaces. |
Beta Was this translation helpful? Give feedback.
-
For anybody interested, the conversation continued here: hylo-lang/wg21#2 |
Beta Was this translation helpful? Give feedback.
-
How straightforward and granular will c++ and val interop be? Do you plan to continue trans-piling to c++ mid to long term? I actually think this is a pro since it can boost adoption by simplifying the implementation of interop and integration with build systems
Beta Was this translation helpful? Give feedback.
All reactions