3 ms·
In general if you are writing a game (that you expect to ship on multiple platforms) you’ll have some cross-platform layer that makes swapping out runtimes for
by meheleventyone 7y ago
In general if you are writing a game (that you expect to ship on multiple platforms) you’ll have some cross-platform layer that makes swapping out runtimes for each platform easy. Then the game is built on top of that. Could be in the same language or in another or both. For example LuaJIT has been popular. WebAssembly provides another target.
Browsers are similar in that they are like mini-sandboxed OS’s with “standardised” interfaces. So applying the idea of standardised, sandboxed interfaces to WebAssembly you end up with WASI and probably eventually extension to GPU, audio and other interfaces useful to games.
It’s actually a pretty old idea, plenty of old games were actually written to run on interpreters that were then rewritten for each platform. For example Another World which has cropped up on the front page recently takes this approach.