Impl Foo {extern "C" fn bar(&self) {}}

Imagine if this produced a simplified name mangle

qux.rs
impl Foo {
    extern "C" fn bar(&self) {}
}
produces a C symbol:
   qux_Foo_bar(...)

Given that rust functions aren’t overloaded, you could probably get a long way with this exposing interfaces through C whilst looking decent in rust then we just need to convince C++ to follow suit…

namespace qux { class Foo { extern “C” void bar(); // equivalent: qux_Foo_bar } }

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.