5 ms·
Embedding Truffle Languages
- chrisseaton 4y agoIf you've heard of Truffle or Graal you probably know that it can run as a JIT or produce a standalone executable, but there's actually so many more configurations it can run in - it's a true universal runtime system.
- pestatije 4y agoI wish Graal target wasm platform
- chrisseaton 4y agoIt has an LLVM IR backend, which you can then translate to WASM. Not sure if I've seen any examples of anyone doing this though.
- yarg 4y agoDoes it? I know it supports executing LLVM IR - but that's not the same as a target platform. https://www.graalvm.org/22.1/reference-manual/llvm/ https://www.graalvm.org/22.1/reference-manual/llvm/ Sorry, seems that you're right: https://www.graalvm.org/22.1/reference-manual/native-image/LLVMBackend/ https://www.graalvm.org/22.1/reference-manual/native-image/L...
- a1369209993 4y ago> I know it supports executing LLVM IR - but that's not the same as a target platform. Specifically, that's a source platform, which is basically the opposite of target platform.
- chrisseaton 4y agoGraal also has LLVM as a target platform, is what I said.
- gavinray 4y agoWell, that's new. That is really cool and opens up some neat usecases.
- a1369209993 4y agoThat's what you said: > It has an LLVM IR backend [ie, LLVM IR as a target platform] The quote in my previous comment was from yarg, and (as stated) was describing a source platform.
- alex7o 4y agoThere is wasm support already. https://www.graalvm.org/22.1/reference-manual/wasm/ https://www.graalvm.org/22.1/reference-manual/wasm/
- pjmlp 4y agoGraal is a runtime, what would that help? There are already enough of WASM runtimes, Graal itself, as others pointed out.
- chrisseaton 4y ago> what would that help? For example to let you run Java code in a browser.
- pjmlp 4y agoStill don't get why Graal, which is mostly something like LLVM for Java matters in such scenario. What one wants is a .class to WASM converter and there already a couple of them to choose from, namely TeaVM and CheerpJ as the most advanced ones.
- chrisseaton 4y ago> What one wants is a .class to WASM converter and there already a couple of them to choose from, namely TeaVM and CheerpJ as the most advanced ones Do they provide the kind of best-in-class whole-world-analysis optimisations that Graal does? But we should take a look at what they produce some time! I think in practicality Graal's LLVM output is not terribly platform agnostic, as LLVM lacks some expressiveness for the thing that Graal needs to do for deoptimisation.
- pjmlp 4y agoThat task is taken over by browser JIT engines, hence I still don't get why Graal should be generating WASM bytecodes to start with. Naturally consuming them as yet another WASM runtime makes sense, but that isn't what OP was asking about.
- chrisseaton 4y ago> That task is taken over by browser JIT engines But you can't apply high-level optimisations by the time all you have is WASM bytecode and all your high-level structure is gone. You also don't have enough time to apply these optimisations if you're JIT compiling.