Yesterday I was able to compile and run a game I'm making bit-perfect (physics world snapshot is the same) on linux and windows (via wine) cross compiled from the same machine.
I'm happy that it's possible and working, but so confused why this is not something that comes out of the box. A long chain of technical decisions led to the world where a simple game written in C needs to be aware of multiple CPU architectures, OSes, graphics APIs, display servers, sound subsystems to have a chance to work properly on platforms it knows about.
Cross platform support is difficult because platforms made it difficult and have no incentive to befriend.
I hope one day we get posix v2 with performant standard APIs to not worry about platforms in application's code. Perhaps 2035?
> A long chain of technical decisions led to the world where a simple game written in C needs to be aware of multiple CPU architectures, OSes, graphics APIs, display servers, sound subsystems to have a chance to work properly on platforms it knows about.
If an API that works on all of them and makes your code portable (or almost portable) isn't acceptable, I'm not sure what you expected a solution to be in that case.
> "so confused why this is not something that comes out of the box
If you want your code to work on multiple CPUs and OSs, there is no single "box" you can blame. There are multiple "boxes" which naturally don't have completely unified native APIs. Libraries like SDL make the complexity of writing portable projects easier to deal with if you don't want to deal with the native APIs.
> A long chain of technical decisions led to the world where a simple game written in C needs to be aware of multiple CPU architectures, OSes, graphics APIs, display servers, sound subsystems to have a chance to work properly on platforms it knows about.
It’s all about workloads and needs. You can’t put a sedan’s engine into a semitruck even if the basic components are the same. Windows were all about the microcomputer while Unix was designed to run in servers. The abstraction differences can be smoothed over, but it’s hard work and not everyone is keen to do so. And because they’re abstraction and not physical constraint, some would rather invent a new one (OpenGL).
> I hope one day we get posix v2 with performant standard APIs to not worry about platforms in application's code. Perhaps 2035?
A more pragmatic option is to design you app and push platform concerns to the edge. Then you just reimplement the exterior shell while keeping the core logic unchanged.
I'm happy that it's possible and working, but so confused why this is not something that comes out of the box. A long chain of technical decisions led to the world where a simple game written in C needs to be aware of multiple CPU architectures, OSes, graphics APIs, display servers, sound subsystems to have a chance to work properly on platforms it knows about.
Cross platform support is difficult because platforms made it difficult and have no incentive to befriend.
I hope one day we get posix v2 with performant standard APIs to not worry about platforms in application's code. Perhaps 2035?
Replies (2)
Doesn't SDL solve most of those problems?
Replies (1)
Replies (1)
> "so confused why this is not something that comes out of the box
If you want your code to work on multiple CPUs and OSs, there is no single "box" you can blame. There are multiple "boxes" which naturally don't have completely unified native APIs. Libraries like SDL make the complexity of writing portable projects easier to deal with if you don't want to deal with the native APIs.
It’s all about workloads and needs. You can’t put a sedan’s engine into a semitruck even if the basic components are the same. Windows were all about the microcomputer while Unix was designed to run in servers. The abstraction differences can be smoothed over, but it’s hard work and not everyone is keen to do so. And because they’re abstraction and not physical constraint, some would rather invent a new one (OpenGL).
> I hope one day we get posix v2 with performant standard APIs to not worry about platforms in application's code. Perhaps 2035?
A more pragmatic option is to design you app and push platform concerns to the edge. Then you just reimplement the exterior shell while keeping the core logic unchanged.