Types (interface contracts) are already easily sharable with an IDL and code generation. There's no need to stick to a common programming language to share types.
I'm highly skeptical of code sharing for other scenarios, and rarely (never) have seen the effort worth the payoff.
- https://protobuf.dev/
- https://smithy.io/2.0/