Hacker News new | ask | show | jobs
by rkeene2 2115 days ago
The LLVM IR isn't portable. e.g., you can't take the LLVM IR for one CPU or OS and use it on another CPU or OS.
1 comments

Ah, didn't realize it wasn't portable.
It makes sense if you think about it -- the front-end that used LLVM to create this IR consumed a whole lot of platform specific information, like the layout of structs, system call numbers, library names, and function names, etc and distilled it to something that knows the results of those things but no longer knows how they were derived, so it couldn't be applied as-is to some other platform.

This is why WebAssembly needs a runtime framework for making things outside WebAssembly accessible to WebAssembly code -- it has to build an abstraction around all kinds of different systems.

It's even worse, though, for LLVM IR, since it targets a specific type of CPU in various ways, where WebAssembly is a single ISA.