[GHC] #14572: Document for writing GHC-based compiler

#14572: Document for writing GHC-based compiler -------------------------------------+------------------------------------- Reporter: zaoqi | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14572 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14572: Document for writing GHC-based compiler -------------------------------------+------------------------------------- Reporter: zaoqi | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Does wiki:Commentary/Compiler/API help? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14572#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14572: Document for writing GHC-based compiler -------------------------------------+------------------------------------- Reporter: zaoqi | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by zaoqi): Replying to [comment:1 bgamari]:
Does wiki:Commentary/Compiler/API help? It doesn't
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14572#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14572: Document for writing GHC-based compiler -------------------------------------+------------------------------------- Reporter: zaoqi | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by nomeata): Does https://github.com/nomeata/veggies serve as an example of writing your own Core→LLVM compiler, and resuing GHC for the rest? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14572#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14572: Document for writing GHC-based compiler -------------------------------------+------------------------------------- Reporter: zaoqi | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by zaoqi): Replying to [comment:3 nomeata]:
Does https://github.com/nomeata/veggies serve as an example of writing your own Core→LLVM compiler, and resuing GHC for the rest? I want to write Core→Lisp compiler.
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14572#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14572: Document for writing GHC-based compiler -------------------------------------+------------------------------------- Reporter: zaoqi | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): It looks like nomeata's `veggies` would be a great start in that case. It looks like https://github.com/nomeata/veggies/blob/master/Veggies/CodeGen.hs may be a good place to start looking. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14572#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14572: Document for writing GHC-based compiler -------------------------------------+------------------------------------- Reporter: zaoqi | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by zaoqi): Replying to [comment:5 bgamari]:
It looks like nomeata's `veggies` would be a great start in that case. It looks like https://github.com/nomeata/veggies/blob/master/Veggies/CodeGen.hs may be a good place to start looking. Do let us know if there are any specific questions. Is there document for Core?
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14572#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14572: Document for writing GHC-based compiler -------------------------------------+------------------------------------- Reporter: zaoqi | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari):
Is there document for Core?
The [[https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/CoreSynType|GHC commentary]] has a number of references. There is also the [[https://www.microsoft.com/en-us/research/publication/system-f-with-type- equality-coercions/|System FC paper]] although it may be a bit dense to start with. The Notes in `compiler/coreSyn/CoreSyn.hs` are also quite helpful. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14572#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14572: Document for writing GHC-based compiler -------------------------------------+------------------------------------- Reporter: zaoqi | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj):
Is there document for Core?
Actually Core is rather carefully documented. Look in [https://github.com/ghc/ghc/tree/master/docs/core-spec docs/core-spec]. For convenience (and against convention, since it's a generated file) there's a [https://github.com/ghc/ghc/blob/master/docs/core-spec/core- spec.pdf typeset PDF] there too. Richard wrote this document. I like to keep it up to date. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14572#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC