5 ms·
LLVM bitcode is far worse than WASM bytecode as a standard binary interchange format. It is intentionally non-portable and unstable by its designers. Google tr
by Rusky 7y ago
LLVM bitcode is far worse than WASM bytecode as a standard binary interchange format. It is intentionally non-portable and unstable by its designers.
Google tried using it for this purpose with PNaCl and it wasn't great. Apple makes it work by strictly controlling the target hardware they use it for, and with massive investment in the toolchain.
- chrisseaton 7y agoI didn't claim it was a good binary format - I just claimed GraalVM supports it, which it does.
- afiori 7y agoBut it is not an application delivery format which is the whole point here.
- pjmlp 7y agoSure it is, that is what watchOS uses.
- chrisseaton 7y agoI ship LLVM to deliver applications just fine.
- repolfx 7y agoThat's more a criticism of C rather than LLVM. Bitcode isn't as portable or stable as JVM bytecode because real world C programs use processor specific intrinsics, make assumptions about endianness and word sizes, embed assembly etc etc. LLVM is designed to support all real C programs, which means it can't be entirely portable. Wasm today is a toy hardly anyone uses. It can't run many real world C programs which means they'll need to be "ported" to the subset of C wasm supports. Well, if you're willing to work with that constraint you can constrain bitcode in the same way. By the way Graals LLVM support can execute multiple bitcode versions, with seamless and fast language interop, and it virtualises execution so that e.g. a subset of x86 assembly can be cross compiled on the fly to other arch's. It's needed because so much real C doesn't target an abstract machine but real CPUs.
- pjmlp 7y agoActually LLVM Bitcode can be made portable, that is what Apple does in their store apps for watchOS.