-
Is it possible to compile/port SubstrateVM to wasm and run in a browser? Using LLVM? Would this even be feasible? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
In principle, yes - this would be possible. Graal.NodeJS already exposes a part of the V8 API to integrate with the rest of NodeJS, so it could be embeddable into the browser, e.g. Chrome. |
Beta Was this translation helpful? Give feedback.
-
Hi Axel. Thanks for your answer. I am still very fuzzy on all the tools and systems in the whole Graal ecosystem. If I understand correctly, Substrate VM has a few target systems, i.e. amd64 & arm and then OSs, i.e. Windows & Posix. These define the interface to the underlying system that needs to provide memory management, threads etc. So it would be necessary to create an additional target for webassembly. Then the javascript apis in webassembly would be used to implement the threads etc. Is this the nodejs part you are referring to? Thanks for clarifying, it all still very confusing to me right now. |
Beta Was this translation helpful? Give feedback.
In principle, yes - this would be possible. Graal.NodeJS already exposes a part of the V8 API to integrate with the rest of NodeJS, so it could be embeddable into the browser, e.g. Chrome.
Note that not all of the V8 API is implemented in Graal.NodeJS - only the parts that are required by NodeJS are implemented. The part of the V8 API that is currently not supported are some GC-related operations that would require modifying OpenJDK/HotSpot in the JVM version of Graal.NodeJS. Browser integration would need these parts. However, on the SubstrateVM version of Graal.NodeJS, the GC is itself implemented in Java, and can be modified, so one can more easily implement the missing V8 APIs that ar…