dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.22k stars 4.72k forks source link

.NET 9 Unsafe Study #94941

Open AndyAyersMS opened 11 months ago

AndyAyersMS commented 11 months ago

In .NET 9 we plan to study the use of unsafe constructs within the BCL, to better assess the risks they incur and benefits they provide. The aim of this study is to ensure we are making responsible use of unsafe.

The scope and outcome of this study is not yet determined, but may include things like:

Initially we will be gathering data about overall usage (and how it has changed over time) and doing case studies of code that uses unsafe constructs. As the study progresses, we will update this issue to keep track of interim findings, examples, discussions, proposals, and eventually, plans and work items.

ghost commented 11 months ago

Tagging subscribers to this area: @dotnet/area-meta See info in area-owners.md if you want to be subscribed.

Issue Details
In .NET 9 we plan to study the use of unsafe constructs within the BCL, to better assess the risks they incur and benefits they provide. The aim of this study is to ensure we are making responsible use of unsafe. The scope and outcome of this study is not yet determined, but may include things like: * Modernizing the definition of “unsafe” (or unsafe-equivalent) code * Guidelines for introduction of new unsafe code in the BCL, and possibly guidelines for general .NET development * Identification of existing unsafe code that can be replaced with safe equivalents * API changes or additions to avoid the need to rely on unsafe constructs * Recommendations for new or improved JIT optimizations to widen the set of unsafe code that can be replaced * Tooling to track the aggregate amount of unsafe code * The possibility of using source generators to “safely” generate unsafe code Initially we will be gathering data about overall usage (and how it has changed over time) and doing case studies of code that uses unsafe constructs. As the study progresses, we will update this issue to keep track of interim findings, examples, discussions, proposals, and eventually, plans and work items.
Author: AndyAyersMS
Assignees: -
Labels: `area-Meta`, `User Story`
Milestone: 9.0.0
jeffhandley commented 3 months ago

@AndyAyersMS I know we made some progress on this in 9.0.0. I'm going to move this to 10.0.0 to keep the effort going.