Hacker News new | ask | show | jobs
by Mindless2112 689 days ago
Here's a talk about how CrossCode was ported to Switch: https://www.youtube.com/watch?v=KfBzlzvt8RU
1 comments

Really interesting watch, thanks for sharing!

So, if I understand correctly, this is roughly what he did:

1. Wrote a transpiler to convert the subset of Javascript used by CrossCode into a dialect of Haxe.

2. Selectively modified his version of Haxe in small ways to more closely match the semantics of Javascript, to make writing the transpiler easier.

3. Selectively re-wrote complicated parts of the Javascript code into Haxe directly, so that his transpiler didn't have to handle them.

4. Transpiled <canvas> and other browser API calls into calls to his own pre-existing Kha framework for Haxe, which provided similar APIs.

5. Compiled the Haxe output into C++.

6. Compiled the C++ to native code.

Damn.