grain { } CE
Define grains declaratively with rich CE keywords: state machines, handlers, lifecycle hooks, reminders, timers, and persistence in idiomatic F#.
Microsoft Orleans is one of the strongest virtual actor runtimes on .NET. But in raw C# style, F# teams often end up with mutable state classes, attribute noise, and repetitive infrastructure code.
Orleans.FSharp keeps full Orleans power while giving you a functional-first authoring model: computation expressions for grain and hosting setup, explicit state transitions, and typed message flows.
type CounterGrain() = inherit Grain<int>()
override this.OnActivateAsync(ct) = this.State <- 0 Task.CompletedTask
member this.Increment() = this.State <- this.State + 1 this.WriteStateAsync()let counter = grain { defaultState 0 handle (fun state cmd -> task { match cmd with | Increment -> return state + 1, box(state + 1) }) persist "Default"}The F# version is shorter, immutable, and the compiler checks exhaustive pattern matching.
grain { } CE
Define grains declaratively with rich CE keywords: state machines, handlers, lifecycle hooks, reminders, timers, and persistence in idiomatic F#.
siloConfig { } CE
Configure clustering, storage, streaming, TLS, health checks, and runtime services without extension-method boilerplate.
eventSourcedGrain { } CE
Event sourcing with pure apply/handle functions and a runtime bridge that keeps event persistence integration straightforward.
FSharpBinaryCodec
Serialize F# DUs, records, options, lists, and maps with minimal ceremony and predictable behavior for mixed cluster scenarios.
1500+ Tests
1500+ unit and integration tests, including property-based verification with FsCheck and autogenerated data via GrainArbitrary.
.NET 10 Ready
Orleans 10 parity with negligible local wrapper overhead compared to real network and storage costs.
| Metric | Value |
|---|---|
| Test suite | 1500+ unit + integration tests |
| CE keywords | 85+ across grain {}, siloConfig {}, clientConfig {}, eventSourcedGrain {} |
| Orleans parity | 100% — Orleans 10 feature surface |
| NuGet packages | 7 — core, runtime, testing, event sourcing, analyzers, generator, templates |
| License | MIT |
| Local API overhead | ~8ns in benchmark scenarios |
dotnet new install Orleans.FSharp.Templatesdotnet new orleans-fsharp -n MyAppcd MyAppdotnet build && dotnet testA working Orleans.FSharp solution with a counter grain, FsCheck property tests, and silo configuration — ready in under 2 minutes.
Orleans.FSharp
Core developer surface: grain CE, GrainRef, streaming, logging, reminders, timers, observers, serialization.
Orleans.FSharp.Runtime
Hosting and client runtime: siloConfig {} and clientConfig {} builders for production setup.
Orleans.FSharp.Abstractions
C# shim for Orleans proxy generation around IFSharpGrain (reference from silo, no hand-written stubs).
Orleans.FSharp.EventSourcing
Event-sourced grains with eventSourcedGrain { } and runtime integration helpers.
Orleans.FSharp.Testing
TestHarness, WebTestHarness, MockGrainFactory, GrainArbitrary, and log capture utilities.
Orleans.FSharp.Analyzers
Compile-time safety checks (for example OF0001 for async { }) with explicit opt-out where needed.
Every major Orleans capability, wrapped in idiomatic F#:
eventSourcedGrain { } with snapshot strategiesTransactionalState wrapper for ACID operations