Skip to content

Eliminate string-y Id lookups in Wasm backend

It appears that the Wasm backend has a rather atypical way of referring to base declarations. For instance, GHC.HsToCore.Foreign.Wasm has many mentions like:

  unsafeDupablePerformIO_id <-
    lookupGhcInternalVarId
      "GHC.Internal.IO.Unsafe"
      "unsafeDupablePerformIO"

This is very brittle and inconsistent with how similar references occur elsewhere in GHC. Specifically, this sort of reference should be realized by giving the declaration a known-key name (c.f. GHC.Builtin.Names) and using dsLookupGlobalId to lookup the identifier.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information