akkadotnet / akka.net

Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
http://getakka.net
Other
4.73k stars 1.04k forks source link

Epic: Full AOT Support for Akka.NET #7246

Open Aaronontheweb opened 5 months ago

Aaronontheweb commented 5 months ago

Is your feature request related to a problem? Please describe.

Part of the goal for Akka.NET v1.6 is to be able to get Akka.NET to run everywhere:

One of the major advantages Akka.NET has over Orleans et al is our versatility - we're not dependent on external cloud infrastructure in order to run. Akka.NET's ability to run in a stand-alone .NET process with in-memory messaging is a tremendous source of value for developers. We should lean into this.

The future of .NET is to expand beyond Windows and even x64 architectures - Ahead-of-Time Compilation, "AOT," is what will open the door for Akka.NET to be able to run on an even larger number of platforms more efficiently than it can today. So for v1.6 we are putting "full AOT support" on the critical path.

Requirements

Where are the problem areas that prevent full AOT support today? My AOT canary implementation on TurboMqtt highlights some of the big ones: https://github.com/petabridge/TurboMqtt/pull/25

All of these will need to be addressed, gradually, by leveraging tools like the Setup class (replaces HOCON-driven Type loading with static-linking-friendly loading) and changing the way some of Akka.NET's built-in components attempt to load configuration.

Things Users Need to Do To Prepare for AOT

If you care about AOT, please read the next sentences carefully:

If you have any other thoughts or suggestions when it comes to AOT support, please leave them here.

evelant commented 2 months ago

Is AOT possible at all right now? I'm learning F# with an avalonia side project and I'd like to be able to use akka on all platforms avalonia supports (web, ios, android, mac, linux, windows, even embedded).