From the other now closed thread, WebAssembly
is relatively new, but has some highly portable merit, and if new byte codes are going to be invented for P2, why not use an existing body of work ?
Checking back into fasmg forum, reveals this mention
and this wiki
and this seems a good idea :
It defines a WebAssembly binary format, which is not designed to be used by humans, as well as a human-readable "Linear Assembly Bytecode" format that resembles traditional assembly languages.
Seems quite new, but also well resourced. ("The team working on WebAssembly includes people from Mozilla, Microsoft, Google and Apple."
Can P2 byte-code work, leverage those WebAssembly byte-codes, and so tap-into a ship-load of resource ?
Seems the text "linear assembly bytecode" (Intermediate Representation)
is a very good idea, and Spin could generate that, and then compile that to P2 byte codes.
That common pivot point, also means any
language that generated "linear assembly bytecode" source, could be used.
The work done in the fasmg forum, has this link
which shows some of the framework needed to do the IR -> .wasm(binary) step.