Hacker News new | past | comments | ask | show | jobs | submit login
.NET 7 Preview 2 (microsoft.com)
30 points by DeWilde on March 16, 2022 | hide | past | favorite | 4 comments



It's awesome to see NativeAOT support landing in .NET 7. That will be a big win for those who want to use NativeAOT for smaller binaries and faster startup time. This Twitter thread from David Fowler does a good job of summarizing the pros and cons of NativeAOT:

https://twitter.com/davidfowl/status/1391580410119819265


Why does the generated Regex need to be a partial field in a partial class? Why didn’t they make it something like:

    Regex myRegex = Regex.Generated(“…”)
or

    Regex myRegex = MyRegex()

    [RegexGenerated(…)]
    partial class MyRegex {}


.Net source generators can't modify existing code, they can only add additional code files, so your first example wouldn't be able to be rewritten by the source generator.

You can read the development discussion and syntax reasoning in the GitHub issue: https://github.com/dotnet/runtime/issues/44676


Seems like they focus mostly about perf and under the hood stuff in .NET 7?




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: