We're finding Unity ECS, DOTS and Burst to be really useful and crucial to our current project (Thank you! ๐). One issue we've been facing is that occasionally we encounter memory corruption issues that take considerable time to diagnose and fix. At its worst, there are concerns that burst utilises C# in ways it was not designed for, and as such the language lacks the information/awareness to aid the developer in avoiding certain unsafe behaviours. In some ways it is actually less safe than modern C++ for which common practices & tooling exists, preventing such issues.
An example is the Colliders in Unity Physics, which use a form of native, unsafe polymorphism (casting pointers to memory). One of the issues we had was tracking down misbehaving raycasts, only to eventually find that we had omitted a ref keyword from one local variable, resulting in a copy-by-value of a Collider type (not the CapsuleCollider that was actually stored at that memory location), resulting in a partial-copy. This then led to code accessing this "truncated" value in memory as if it was a full CapsuleCollider, at which point it accessed the random values adjacent to it in memory, causing nonsense results. We have encountered this particular (missing ref keyword) issue twice in our project, both times causing a fair amount of angst to debug.
We're curious to know what Unity's long-term plans are for mitigating this, to reduce the "foot-gun" nature of Burst-compatible C#? Tooling for diagnosing memory corruption? Better static analysis? I'm curious to know what Unity's vision for a glorious burst-compiled future is! ๐