Hacker News new | ask | show | jobs
by jdnxudbe 688 days ago
I am not familiar with either Rust or the Switch, so maybe you can enlighten me: why would a Rust game be challenging on the Switch?

As long as you have a good C ffi (which Rust has), shouldn't it be quite easy?

Or is the Switch more similar to Android/iPhone where you cannot (could not?) run native code directly but have to use a platform specific language like Java or Objective C?

2 comments

AFAIK some (all?) console vendors require you to use the compiler toolchain from their SDK to compile your code. So unless the console SDK includes a Rust toolchain the only way is to somehow translate the Rust code to C or C++ and compile that with the SDK compiler.

Maybe if the console SDK toolchain is Clang based it would also work to go via LLVM bitcode instead of C/C++ though.

As flohofwoe pointed out, you are limited by the console vendor SDK, the compiler toolchains, and everything required to target their OS, linker, API, ABI,...