Interoptopus ๐Ÿ™

April 13, 2026 ยท View on GitHub

crates.io-badge docs.rs-badge license-badge rust-version-badge rust-build-badge

Interoptopus ๐Ÿ™

Productive, performant, robust interop for Rust. Pick three.

With Interoptopus you can write code like this:

#[ffi(service)]
pub struct Hello {}

#[ffi]
impl Hello {
    pub fn world() -> Result<Self, Error> { Ok(Self {}) }
}

and then call it from your other language like this:

var service = Hello.World();

Its key features include:

  • Nanosecond fast.
  • Supports structs, data-enums, callbacks, services, async, idiomatic error handling, and much more ...
  • Bidirectional interop, export your Rust library, or load foreign code into your Rust app.
  • Painless workflow, no external tooling required.
  • Polyglot core, first-class support for C#, can support any other language.

Getting Started

Read our documentation here.

Feature Flags

Gated behind feature flags, these enable:

  • macros - Proc macros such as #[ffi].
  • serde - Serde attributes on internal types.
  • tokio - Convenience support for async services via Tokio.
  • unstable-plugins - Experimental 'reverse interop' plugins. Not semver stable!

Supported Languages

LanguageBackend CrateStatus
C#interoptopus_csharpโœ…
Cinteroptopus_cโฏ๏ธ
Pythoninteroptopus_cpythonโฏ๏ธ
OtherWrite your own backend1

โœ… Tier 1 target. Active maintenance and production use. Full support of all features.
โฏ๏ธ Tier 2 target. Currently suspended, contributors wanted!
1 You can implement basic support for a new language in just a few hours, no pull request needed.

Performance

In essence, plain calls are near-zero overhead (1-10ns), as are most structs, enums and services. If serialization is involved it scales with payload size. Using the .NET runtime as a plugin adds ~20 MB overhead.

For more details see our benchmark numbers here.

Further Reading

Contributing

PRs are very welcome!

  • Submit small bug fixes directly. Major changes should be issues first.
  • New features or patterns must be materialized in the reference project and accompanied by at least a C# interop test.