CSharpify Your Engine: A Guide to Embedding C#
summary
Explains how to actually embed C# into a C++ engine: initialize a runtime (Mono or CoreCLR), obtain delegates with corlib_create_delegate, and marshal data across the managed/native boundary. Covers runtime tradeoffs—mono vs coreclr (Mono supports JIT, AOT, interpreter and wide platform support; CoreCLR lacks a production interpreter), Unity’s IL2CPP workaround, and pitfalls like bool-size marshalling bugs. Ships a reproducible example (header + CMake library and a Dear ImGui demo) at the Cify header+CMake library repo.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 3:22Embed C# in C++ engine
- 13:54Java and native calls history
- 25:31C# and CLR collaboration
- 29:13Mono project evolution
- 34:50Mono vs .NET Core
- 36:59Embedding C# basics
- 40:55Initialize runtime with Cify
- 42:23Call C# from C++
- 44:55Demo of embedding C#
- 50:14Pitfalls and data marshalling
- 51:40Automate C++ bindings
- 52:45Q&A
related talks
30mand .NET, what’s next?
56mUnity for the enterprise developer
54mWhy You Should Take Another Look at C#
01h 06mThe State of C# - What Have I Missed?
01h 00mWhere next, C#?
53mSafety first! Low-level C# without the unsafe keyword
01h 00mUnity 101 for C# Developers
32mmruby on C#: From VM Implementation to Game Scripting
