Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit of WASM support #768

Merged
merged 1 commit into from
Feb 20, 2025
Merged

Initial commit of WASM support #768

merged 1 commit into from
Feb 20, 2025

Conversation

dmjio
Copy link
Owner

@dmjio dmjio commented Feb 20, 2025

  • Supports building 8/12 examples w/ the GHC WASM backend
  • Exports main functions for WASM in examples
  • Adds wasm dep. entries to cabal.project
  • Refactors nix infra
  • Removes superfluous CPP (old servant CPP and Monoid)
  • Adds Miso.Runner to abstract over various jsaddle backends
  • Adds common stanzas to cabal files for readability
  • Removes wai dep. in mario example.
  • Migrates haskell-miso.org to Cabal 2.2 (adds shell.nix)
  • haskell-miso.org client can be built w/ WASM
  • Cleans up some -Wall warnings
  • Exposes Miso.Concurrent
  • shell.nix is now dynamic (can take "ghc" or "ghcjs" as an arg)
    • "nix-shell --arg pkg ghcjs"

There are still a few examples outstanding that we could use CPP and raw WASM FFI declarations to support (like the xhr example).

The haskell-miso.org server currently does not compile w/ WASM.

Builds eligible examples below

❯ nix shell 'gitlab:haskell-wasm/ghc-wasm-meta?host=gitlab.haskell.org'
❯ wasm32-wasi-cabal build examples --allow-newer
Configuration is affected by the following files:
- cabal.project
Up to date
❯ file dist-newstyle/*/*/*/*/*/*/*/*/*.wasm
dist-newstyle/build/wasm32-wasi/ghc-9.13.20250212/haskell-miso-0.1.0.1/x/client/build/client/client.wasm:                          WebAssembly (wasm) binary module version 0x1 (MVP)
dist-newstyle/build/wasm32-wasi/ghc-9.13.20250212/miso-examples-1.8.7.0/x/compose-update/build/compose-update/compose-update.wasm: WebAssembly (wasm) binary module version 0x1 (MVP)
dist-newstyle/build/wasm32-wasi/ghc-9.13.20250212/miso-examples-1.8.7.0/x/mario/build/mario/mario.wasm:                            WebAssembly (wasm) binary module version 0x1 (MVP)
dist-newstyle/build/wasm32-wasi/ghc-9.13.20250212/miso-examples-1.8.7.0/x/mathml/build/mathml/mathml.wasm:                         WebAssembly (wasm) binary module version 0x1 (MVP)
dist-newstyle/build/wasm32-wasi/ghc-9.13.20250212/miso-examples-1.8.7.0/x/router/build/router/router.wasm:                         WebAssembly (wasm) binary module version 0x1 (MVP)
dist-newstyle/build/wasm32-wasi/ghc-9.13.20250212/miso-examples-1.8.7.0/x/simple/build/simple/simple.wasm:                         WebAssembly (wasm) binary module version 0x1 (MVP)
dist-newstyle/build/wasm32-wasi/ghc-9.13.20250212/miso-examples-1.8.7.0/x/svg/build/svg/svg.wasm:                                  WebAssembly (wasm) binary module version 0x1 (MVP)
dist-newstyle/build/wasm32-wasi/ghc-9.13.20250212/miso-examples-1.8.7.0/x/todo-mvc/build/todo-mvc/todo-mvc.wasm:                   WebAssembly (wasm) binary module version 0x1 (MVP)
dist-newstyle/build/wasm32-wasi/ghc-9.13.20250212/miso-examples-1.8.7.0/x/websocket/build/websocket/websocket.wasm:                WebAssembly (wasm) binary module version 0x1 (MVP)

- Supports building 8/12 examples w/ the GHC WASM backend
- Exports main functions for WASM in examples
- Adds wasm dep. entries to cabal.project
- Refactors nix infra
- Removes superfulous CPP (old servant CPP and
- Adds Miso.Runner to abstract over various jsaddle backends
- Adds common stanzas to cabal files for readability
- Removes wai dep. in mario example.
- Migrates haskell-miso.org to Cabal 2.2 (adds shell.nix)
- haskell-miso.org client can be built w/ WASM
- Cleans up some -Wall warnings
- Exposes Miso.Concurrent
- shell.nix is now dynamic (can take "ghc" or "ghcjs" as an arg)
  - "nix-shell --arg pkg ghcjs"
@dmjio dmjio merged commit dfde8ea into master Feb 20, 2025
3 checks passed
@dmjio dmjio deleted the support-wasm branch February 20, 2025 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant