Skip to main content

.NET

.NET binding

Status

Planned. Development will begin after the Python binding stabilizes.

Timeline

The .NET binding will target .NET 8+ and is expected to follow the JVM binding in priority.

Architecture

The .NET binding will use the C FFI layer over the core crate, accessed via P/Invoke or the NativeAOT interop model.

C# / F# application code
|
v
Aster.Net library Idiomatic .NET API: attributes,
Task/IAsyncEnumerable async model
|
| P/Invoke or NativeAOT interop
v
libaster.so / .dylib / .dll C FFI shared library built from
the ffi/ crate
|
v
core crate (Rust) Same backend as Python binding
|
v
iroh crates

Key design decisions

  • Attributes will replace Python's decorators: [AsterService], [Rpc], [WireType("ns/Type")].
  • Records (C# 9+) are the natural equivalent of Python dataclasses for wire types.
  • Apache Fory .NET (or a compatible Fory implementation) will handle XLANG serialization for wire compatibility.
  • Async model will use Task<T> for unary calls and IAsyncEnumerable<T> for streaming patterns.
  • P/Invoke provides the simplest FFI path. NativeAOT interop may be used for higher performance in AOT-compiled scenarios.

Requirements

  • .NET 8+ runtime or SDK.
  • The libaster native library for the target platform.

Further reading