Re:Show HN: I wrote my own RTS game engine in C
by kmonsen on Wednesday May 12, 2021 @07:47PM
(#27136630)
I think, as a generalization, most communication between languages goes through C. For example Rust or Switft to C++ would go Rust -> C -> C++. Or Switft -> C -> Rust as examples. I think Swift is trying to make C++ bindings, but in general most languages can talk to/from C.
Of course there are other mechanisms, but for direct bindings I think C bindings are by far the most common.
Re:Show HN: I wrote my own RTS game engine in C
by nly on Thursday May 13, 2021 @03:33AM
(#27139397)
Actually for Swift <-> C++ you tend to go via Objective C++, which as easy as renaming your .cpp file to .mm, and calling in to Swift via a bridging header
Of course there are other mechanisms, but for direct bindings I think C bindings are by far the most common.