|
|
|
|
|
by elevader
1617 days ago
|
|
> except it is, WASM is designed to be AOT compiled to native code. Interesting, I didn't know that. How does WASM handle different architectures? Do you build different binaries for x86/arm? Or does it do it the Apple way with the giant bundle that contains all binaries? > Now Unity is so much more then just a tool to make cross platform easier. So comparing it to WASM is kinda pointless IMHO. Though it probably is a grate choice for any extension mechanism, like mods or even in game scripting. Agreed, that was badly worded. Like you said, one could compare a module written in Unity and compiled to whatever Unity compiles to/is implemented in these days with a module in WASM. Edit: Or does the AOT mean that the format that is shipped is some non-native format but the client compiles everything before the first run? |
|
The same way JavaScript or C#/Java do. It's a bytecode format (typically the first stage in today's JavaScript engines is to turn into a bytecode), which the different engines then JIT for the OS and architecture they are running on.
For more details on a couple different engine implementations, you may find the below of interest.
- https://v8.dev/docs/wasm-compilation-pipeline
- https://hacks.mozilla.org/2020/10/a-new-backend-for-cranelif...