in .NET 11.0 we've landed many changes in JIT (applies to NAOT too) to optimize redundant bound checks to make safe code as fast as unsafe (can be tracked via reduce-unsafe label https://t.co/LmGsXEYrPJ). Example: https://t.co/K0F2dZZe4j
@EnZistenZ 1) HPC doesn't have to be unsafe in C# - example https://t.co/FS7bFf8fHq (and a hundred of similar changes under reduce-unsafe label) 2) the reason is very clear - know all the places where you intentionally do things that can easily break/introduce CVEs.
@EnZistenZ we debated a lot on this and decided to follow Rust (aka the most memory safe language) and learn from their experience. See https://t.co/yiBtEm42hb
@hexawyz@KooKiz There should be no reason to use unsafe (except for a tiny layer around pinvokes). We've made a lot of efforts over the last few years improving perf of 100% safe code to be on par with unsafe. 1 unsafe usage is enough to introduce a terrible CVE (most CVEs are memory-safety rel.
@hexawyz@KooKiz forcing developers to audit & refactor all unsafe code is a huge benefit. In modern C# there are way too many unsafe things that most people don't even realize how dangerous they're
@torn_hoof@nietras1 We're working on the migration story, but it will still require some manual audit of all unsafe code and this is by definition an inconvinience for those who write a lot of unsafe code (we want to minimize that in the .NET ecosystem).
@nietras1 We want to make sure developers (and AI) are aware when they deal with unsafe and mark those places, the UX can probably be improved with unsafe-as-expression, but that's not the goal. We also improved a lot of things in the JIT for safe code along the way.
@TeksEdge All these "create a game from scratch" benchmarks never correlate with what I see when I ask an LLM to fix a bug in a real world app ๐ E.g. GPT is so clever for everyone here on X but for me in 9 out 10 attempts Opus just a mile better.
@xoofx I usually just vibe-code my own API clients in such cases. E.g. google forces everyone to use their new Interactions API but there is no C# support in their SDK https://t.co/WmVBeDMLiS
@kskrygan I'm very skeptical about the "1 month" part. Today, the only way to get something remotely as smart as Opus is to get 20x H200 GPUs (say, for 16-bit Kimi K2.6 with a usable context length). I predict the gap will always be too big to prefer local, unfortunately.