4 ms·
> No dynamic allocations are supported (thus no reference type support) No class instances. This is a severe limitation, to the point where it will change the
by SideburnsOfDoom 1y ago
> No dynamic allocations are supported (thus no reference type support)
No class instances. This is a severe limitation, to the point where it will change the character of the language entirely.
- KallDrexx 1y agoIn theory, allocation could be hacked in with an arena allocator. I just need to add in reference type support and custom allocation strategies into the transpiler. Then again, that's only viable if you don't use enough memory to require rom bank switching, or have better control over which class gets placed in which rom bank.
- SideburnsOfDoom 1y agoDoes "no reference type support" also imply "no strings" ? i.e. no instances of the common reference type System.String ?
- KallDrexx 1y agoStrings become `char*` so they are supported as long as they are not dynamically generated (no concatenation for example, but some things like `printf()` templates do work. e.g. https://github.com/KallDrexx/DotnetSnes/blob/master/src/DotnetSnes.Example.Breakout/Game.cs#L185 https://github.com/KallDrexx/DotnetSnes/blob/master/src/Dotn...
- KallDrexx 1y agoAlso, I would point out that there are cases where it doesn't change significant amount of the language or hamper things. The transpiler also works for Linux eBPF kernel side applications without unsafe pointers and other odd things I need to do for SNES. Since you can have methods on c# struct instances, things can still work pretty idiomatically. You also do have statically sized arrays, or heap allocated arrays (the latter is only supported if host C application passes it in before hand, and is responsible for free ing it).