Michal Strehovský

Michal Strehovský

@migeel.sk

I help building the .NET runtime at Microsoft. My tweets are my own opinions and/or shitposts, not the official party line.

709 followers120 following96 posts

1/N I vibe-coded a C compiler that targets .NET IL. It can build unmodified PureDOOM into a .NET app that runs on both .NET 10 and desktop framework.

View full thread

3/N I would probably never actually get to it, but if Anthropic can build an optimizing C compiler from scratch, why wouldn't I be able to make one if I take extra shortcuts (e.g. base it on an existing small C compiler written in C).

4/N Anyway here it is: github.com/MichalStreho.... I'll probably vibe on it a bit more later. It only has one test running in the CI and it literally is DOOM (ensuring we play the expected demoloop). I hit surprisingly few bugs getting DOOM to run with it (once it got past init, it worked), but YMMV

github.comGitHub - MichalStrehovsky/chibil: C compiler for .NETC compiler for .NET. Contribute to MichalStrehovsky/chibil development by creating an account on GitHub.

1/N I vibe-coded a C compiler that targets .NET IL. It can build unmodified PureDOOM into a .NET app that runs on both .NET 10 and desktop framework.

Found Sokol.NET - C# bindings for the Sokol crossplat gfx framework. If you haven't heard about Sokol, it's a C header-only library to build crossplat gfx/audio apps (games). Sokol.NET wraps it for C# (Win/Linux/Mac/Android/iOS/WASM). Tons of samples. Also native AOT: github.com/elix22/Sokol...

github.comGitHub - elix22/Sokol.NET: Cross-platform graphics framework for C# with .NET NativeAOT | Desktop • Mobile • Web | Direct3D • Metal • OpenGL • WebGLCross-platform graphics framework for C# with .NET NativeAOT | Desktop • Mobile • Web | Direct3D • Metal • OpenGL • WebGL - elix22/Sokol.NET

Sorry but the off-color corner of the new Word icon looks like a compression artifact when taskbar is set to small (and sorry but small & never combine & show labels is the only correct taskbar configuration on Windows, this is not macOS).

Michal Strehovský reposted

After #flareon11 challenge 7, I got inspired to build tooling for #dotnet Native AOT reverse engineering. As such, I built a #Ghidra Analyzer that can automatically recover most .NET types, methods and frozen objects (e.g., strings). 👉https://blog.washi.dev/posts/recovering-nativeaot-metadata/

Michal Strehovský reposted

I published part 5 of my "Writing a .NET profiler in C#" series. All the foundations built in the previous articles have been moved to a library named Silhouette. In this new article, we finally have everything we need to write an actual profiler. minidump.net/writing-a-ne... #dotnet

minidump.netWriting a .NET profiler in C#  -  Part 5Part 5 of the series about using NativeAOT to write a .NET profiler in C#. We have all the foundations, we’re finally writing an actual profiler.

Michal Strehovský reposted

Finally had time over the holidays to realize a long-standing dream of mine: a hex editor that knows about the PE file and .NET metadata format. You can click any byte and it will show you which data structure it is in the tree. Every byte is covered. The parser is at github.com/KirillOsenko...

Michal Strehovský reposted

got my custom sokol-backed c# game engine zinc compiling to wasm using nativeaot-llvm! and for anyone else headed in a similar direction, I spent some time writing up what it took, what bugs I encountered, etc! give it a read here #gamedev #zinc #csharp kylekukshtel.com/csharp-wasm-...

kylekukshtel.comSo You Want To Compile Your C# Game Engine To The Web With WASM - k-holeDiving into the NativeAOT-LLVM compile chain to make my game engine work on the web

Forgot that the docs are here: www.nuget.org/packages/siz.... To install, simply `dotnet tool install sizoscope --global` but you'll want to read the docs to find out how to create the files this tool operates on.

nuget.orgsizoscope 1.1.0.NET tool to analyze size of Native AOT binaries.

1/3 New version of sizoscope, my tool to analyze size of .NET native AOT executables, is out! It can now show you sizes of some of the blobs within the executable just to give a more complete picture.

1/3 New version of sizoscope, my tool to analyze size of .NET native AOT executables, is out! It can now show you sizes of some of the blobs within the executable just to give a more complete picture.

2/3 Despite being a dotnet tool (that are not supposed to be native) I compile sizoscope with native AOT now. It starts visibly faster. It will also thunk to Wine if you're not on Windows so installing the tool on non-Windows works great (provided you installed Wine). Looks like this on my Ubuntu:

Thanksgiving is approaching in the US and that means time with family. People in your family were presented with this dialog in the past and probably just clicked the button Google wanted them to click. Ask them if they want to browse the web, or if they want web to browse them.

JIT compiled .NET will often be faster than AOT compiled .NET thanks to dynamic PGO. But AOT compilation has some tricks up the sleeve too. In .NET 9, the TechEmpower JSON benchmark ends up a bit faster with AOT.

1/4 Life hack: uninstalling the Notepad app in Windows 11 gives you back old notepad.exe that starts faster and uses less memory. This Notepad is going to be a bit cursed and registry hacks are needed to uncurse it. 👇

View full thread

3/4 Windows will not allow you to choose this notepad in the "Open with" dialog. If you choose it, you'll be presented with the below window. To fix it, Regedit to HKEY_CLASSES_ROOT\Applications\notepad.exe and delete the NoOpenWith value.

1/4 Life hack: uninstalling the Notepad app in Windows 11 gives you back old notepad.exe that starts faster and uses less memory. This Notepad is going to be a bit cursed and registry hacks are needed to uncurse it. 👇

2/4 Typing notepad<enter> in PowerShell is going to have a ~1 in 10 chance of opening notepad.exe in notepad instead of a blank document (wtf). The fix is to delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe

Last time I got free stuff from Microsoft as an employee was when I got a T-shirt for shipping .NET 6.

Tom Warren@tomwarren.co.uk

Microsoft created a unique purple and blue Surface colorway for employees that worked on the Copilot+ PC launch. This won’t be available to purchase, just something for some Microsoft employees. It looks great in person 👍

The .NET native AOT compiler used to have an unsupported mode where it broke all reflection for size savings. I added the mode in 2019 when Hello World was 4 MB and with broken reflection only 1 MB. It was a good goalpost. In .NET 9 they're both ~1 MB: goalpost reached! github.com/dotnet/runti...