by zeusk · 4y ago · 0 comments
There is a lot of 32 bit microcontrollers, most notable stm32
Admittedly, those probably aren't running on 32-bit systems, nowadays ...
But you are going to need some minimal buy-in from Microsoft first, if not Sony and Nintendo too.
The great thing about carbon is that you can incrementally shift a codebase over from c++, and there are no problems interacting with existing c++ APIs, so the required amount of buy-in is pretty much just "yes, you can use a 3rd party compiler" and maybe some improvements to the debugger.
You actually have to wrap all the c++ functions in c functions, and then call those c functions from rust. Which requires either making manual wrappers, or automated wrapping tools that handle the specific idiosyncrasies of the library you are calling.
Which is a massive barrier; Gamedev standardised on c++ and there are so many c++ libraries.
In comparison, Carbon is designed from the ground up to automatically have bi-directional inter-op with c++. It's what the language is designed to do.
Things must be initialized in Rust. Things must have a single identifiable owner. Things really want to be immutable.
Sure, you can duck these in Rust with lots of "unsafe". But, if you do that, are you really gaining anything from using Rust?
Triangle meshes can be stored quite efficiently and a lot of the modern geometry is tessellated, procedural or replicated.
There are far better optimizations for gamedev like using SOA instead of AOS.