IL2CPP.exe is a Unity utility for converting C# IL code to C++. My question is: can this executable be used outside of the Unity game-development environment as a general-purpose tool for converting any .NET application (not just games) to a high-performance native executable?
Although I do know some C++, It would certainly be nice to be able write all kinds of programs in a language I am comfortable and fluent with (C#)......whether they be audio/video/music-production DAWs or OS-level security/forensics tools or machine-learning platforms or anything else that's resource-intensive.......and know that they will run as efficiently as an app written in straight C++.
IL2CPP is tightly connected to the Unity environment and it's not possible to use it outside of Unity. You would need to write your own converter(?) to do such a thing.
IL2CPP doesn't do any magic in terms of performance improvement. Comparing C++ with C# with IL2CPP code should give (almost - more below) no performance benefit.
IL2CPP is performant compared to C# code written for Unity specifically for few reasons that have nothing to do with C++.
Why Unity is unique and needs IL2CPP:
So why IL2CPP?
Is it worth converting other C# to C++?
No! Compare any arbitrary, optimized C# code that was precompiled by AOT to (modern) C++. You should get the same performance! Identical I would say.
C# is compiled to IL (Intermediate Language) which as the name suggests is Intermediate. It's converted in runtime to Native Binary code (only when needed), that is what C++ is compiled into. You can force this conversion by skipping IL generation by running Ahead of Time compilation (AOT).
The ONLY thing that your C# code will be less performant is when you are abusing GC's ability to clean up after you.