Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,255
    • Issues 5,255
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 562
    • Merge requests 562
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #20927
Closed
Open
Issue created Jan 10, 2022 by Norman Ramsey@nrnrnrDeveloper

Back-end responsibilities are distributed throughout the compiler

A back end for GHC is described by a value of type GHC.Driver.Backend.Backend. This type is an enumeration type. The semantics of a particular value constructor is determined by code spread throughout the compiler: while it would be tedious to count exactly how many modules include a case discrimination on the Backend type, the GHC.Driver.Backend module is imported by over 20 other modules. This distributed semantics makes it a bit challenging to add a new value of Backend type, as is being contemplated for both JavaScript and WebAssembly targets.

One possible remedy would be to keep the existing compiler structure as much as possible, but to make the Backend type abstract, centralizing all the Backend-dependent functionality in one module. Because of the potential for recursive imports, such a refactoring is not quite possible, but an approximation would probably be good enough.

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