Safety first! Low-level C# without the unsafe keyword
summary
Port converts Doom (1992) from C to modern C# without using unsafe keyword, replacing malloc/zone allocator with managed arrays and structs and keeping about 80% feature parity including rendering, input and status bar. Function pointers become delegates and lambdas for live references. Microbenchmarks show preallocated array 6.7µs and preallocated List<T> nearly as fast while dynamic resizing is much worse. Console mode uses Spectre.Console; builds run on Windows, MAUI and Avalonia and the port works and plays.
AI-written summary · about
chapters (11)
- 0:00Project introduction
- 2:53Porting progress
- 5:07Understanding unsafe code
- 9:53Performance benchmarks
- 13:45Memory management techniques
- 20:40Arrays versus lists
- 26:43Binary data processing
- 35:14Implementing game logic
- 40:35Actors and thinkers
- 45:58Console rendering
- 48:15Conclusion and Q&A
related talks
56mFrom Hell to Heaven: Porting Doom to MAUI
46mFrom Hell tp Heaven: Porting Doom to MAUI
56mFrom Hell to Heaven: Porting Doom to MAUI
27mC# as a system language
57mPushing C# to the limit
52mPerformance features in C#
01h 02mDown the Oregon Trail with Functional C#
01h 06mThe State of C# - What Have I Missed?
