-
Notifications
You must be signed in to change notification settings - Fork 216
Description
This is a draft/proposed User Story and not committed for .NET 6.0 yet.
We have seen a surge of interest in statically linked binaries with minimal dependencies in recent years. This is a reversal of a multi-decade trend to deliver dependencies as shared libraries. The benefits to deployment and the ability to optimize a single app outweigh the benefits of sharing for certain types of workloads. The gain is most significant for workloads with a high number of deployed instances: cloud infrastructure, hyper-scale services, popular apps or games. The number of apps of this type is relatively small, but they are highly visible, impactful, and often cost a lot of money to operate (savings can be meaningful).
Emerging programming environments (e.g. Go, Rust) tend to be designed for this form factor. Established programming environments are catching up on this trend to be relevant for this highly visible segment, for example Java Graal, Dart, Kotlin/Native.
Various implementations of .NET (Xamarin, Unity, .NET Native) have demonstrated that .NET is well suited to native AOT in terms of fundamentals, however, there are tools experience and ecosystem challenges that currently prevent .NET from being a great general purpose solution. We intend to start addressing these issues with this project. It is very likely that the first set of improvements will have rough edges that may prevent adoption for some developers. We will use feedback to determine which experience issues to prioritize. We are also not comitting to any particular end point for this project, at this time.
This high level section sets our intention to invest in native AOT scenarios and more definition from the teams will be needed to define our phased approach over the next few .NET releases.
Work Items / User stories
- Source Generators should be created to replace existing reflection heavy code with build-time source generation so that it can be used in a native AOT environment.
- System.Text.Json serialization – code generators can work around the need for runtime reflection, and generate serializers for specific classes. Developers apps using JSON serialization start up and run faster runtime#1568
- EventSource – event source uses reflection.emit to simplify creation of classes (manifests) for custom event sources – this can be changed to a build-time activity using source generators. Developers can employ EventSource APIs when publishing for AOT targets to be able to use .NET tracing capabilities runtime#43390
- Invest in wider platform support and debugging support for Native AOT Developers can use native AOT experiment to target Windows and Linux ARM64 #336
- Developers can precompile their Regex code for faster startup Developers can precompile their Regex code for faster startup runtime#44676
- TBD