
A bit of a .NET focus today
- Unlocking More Power: Tool Calling in GitHub Copilot for Visual Studio - Visual Studio Blog - Visual Studio Copilot now has more context control, it can now look at VS itself, debugger stacks & locals, multiple files. This is pretty cool and reminds me of what https://zed.dev/ are doing with their AI context for code suggestions, I’d expect VS Copilot to do suggestions which you can apply like a PR review in the very near future.
- https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/extract-schema - .NET 9 has JSON schema exporter, which can get you POCO JSON type and give you the schema by the type itself, something super handy for converting a type to a JSON schema with descriptions!
- https://steven-giesel.com/blogPost/59752c38-9c99-4641-9853-9cfa97bb2d29 + https://github.com/dotnet/runtimelab/blob/feature/async2-experiment/docs/design/features/runtime-handled-tasks.md - This one requires a in-depth understanding of async, David Fowler recommended this blog, the summary is - the .NET team is trying to improve async performance and experimented using green threads, which are threads not managed by the operating system (Go and many other languages use green threads for asynchronous work), which as a PoC did work but would introduce another async programming model into .NET which they wanted to avoid. Instead they’re doubling down on the existing async model in .NET and trying to get performance gains out of it. Dynamic PGO (Profile Guided Optimization) was introduced in .NET 8 (PGO is introduced in other languages like C++, Java hotspot), dynamic PGO will profile your code at runtime in JIT and change the code with tests/guards to see if it optimizes the code, such as in-lining or converting types (List to Array is an example) or hoisting the concrete implementation and removing the interface (crazy stuff), the JIT still needs to know the original code and new JIT re-compiled code to keep the call stack and map the call sites back from the new code. Coming back to async2/runtime async, the .NET team tried improving on async with 2 experiments, 1 being a VM implementation and the other being JIT PGO, but both remove SynchronizationContext and ExecutionContext (something you can do now like
await client.GetStringAsync("http://example.com/").ConfigureAwait(false);, this does change the behaviour ofAsyncLocal<T>as the context is not overridden like a ref, instead it’s more like a functional call chain. They also wanted to try tackle nested awaits and the tasks’ state machines overheads that it comes with, by in-lining a the nested tasks. - .NET 9 Networking Improvements - .NET Blog - Some nice additions for Keyed DI using MS DI, websockets (WSS) can now be set with keep alive config, HTTP3 connection pool multiplexing has some serious scaling improvements as it’s able to support more concurrent requests and not bottleneck or throttle as much - this may be really good for S2S HTTP communication if both apps support it.
- Building .NET AI apps with Chroma - .NET Blog: Chroma DB, an open source AI vectorized database, now has a C# SDK, which seems like move to get more open source AI uses to move to Azure
