Skip to content
Snippets Groups Projects
Commit 1f67f423 authored by Cheng Shao's avatar Cheng Shao :beach:
Browse files

wasm: implement wasm ghci browser mode

This commit implements the rest of dyld logic that delivers the ghci
browser mode:

- The dyld script can now fully run in the browser. It communicates
  back with dyld-on-nodejs via WebSockets and also plain HTTP 1.1
  requests.
- The host dyld starts a server and acts as a broker between the GHC
  process and the browser side. GHC doesn't need to know anything
  about the browser mode; no driver flags need to be added and no
  recompilation needs to happen, the GHC driver continues to use the
  original iserv binary messages protocol.
- The dyld broker doesn't need to parse any message between the
  browser dyld and GHC; it merely sets up WebSockets connections to
  redirect these messages as well as ^C signals.
- Plain HTTP 1.1 is used for IPC requests (e.g. downloading a wasm
  module).
- The dyld broker serves a main.js script that bootstraps iserv in the
  browser, and a main.html empty page playground for testing. CORS is
  enabled so it could be possible to inject iserv into other websites
  and use ghci to play with them.
- All the RPC logic is opaque to the DyLD class, the majority of the
  wasm dynamic linker code is already portable and runs fine in
  firefox/chrome/webkit.

Closes #25399.

(cherry picked from commit e93fc33d)
parent 9d22e71d
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment