4 ms·
C# has a similar memory model and it's the primary language used by Unity games... would you say that's un-viable?
by shawnz 5y ago
C# has a similar memory model and it's the primary language used by Unity games... would you say that's un-viable?
- throwaway34241 5y agoFor memory layout C# actually has an important difference in that it supports value types (so you can have an array of vertices without individually allocating each one, which has a lot of overhead and drastically reduces cache efficiency). They’ve been working on adding support for that to Java for some time but it’s not in yet.
- kllrnohj 5y agoThe game engine is different from the game logic. This may mean Java is more viable for game logic, but still not viable for the engine itself That said, C# has value types and has for years now. Which is hugely important for arrays, and a major, major missing piece to the Java performance puzzle. C#'s FFI is also way better than the disaster that is JNI, which also plays a role here.
- kaba0 5y agoYou are right, but I would like to add that both of these concerns will be solved in the near-far future. Java’s project Panama tries to tackle the less than ideal FFI case with a tool that can create java classes from a C header and an API for manually managing memory regions. While Valhalla is in the works, but it is, I quote, at least 3 PhD’s worth of knowledge combined to figure it out in a backwards compatible way with all the interactions of generics, etc.