[GHC] #9703: Add missing calling conventions to Template Haskell

#9703: Add missing calling conventions to Template Haskell -------------------------------------+------------------------------------- Reporter: luite | Owner: ekmett Type: feature request | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 7.9 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Easy (less than 1 | Type of failure: hour) | None/Unknown Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Template Haskell only supports the `CCall` and `StdCall` calling conventions, while GHC supports more: http://git.haskell.org/packages/template- haskell.git/blob/9bcc122819a6f4a2ae7ad569717324b8368e801c:/Language/Haskell/TH/Syntax.hs#l1311 http://git.haskell.org/ghc.git/blob/7369d2595a8cceebe457a44c8400828f4df87ea0... `CApiConv`, `PrimCallConv` and `JavaScriptCallConv` are missing, and I think they should just be added unless this is expected to lead to problems. I'd personally like to have `JavaScriptCallConv` so I can remove the horrible hacks to make ghcjs-ffiqq (https://github.com/ghcjs/ghcjs-ffiqq) work. I imagine that `PrimCallConv` would be useful for a package using a similar approach for high performance inline assembly or LLVM with quasiquotes. A small change in GHC required to convert the new constructors, and possibly to check if the required extension is enabled. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9703 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9703: Add missing calling conventions to Template Haskell -------------------------------------+------------------------------------- Reporter: luite | Owner: ekmett Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.9 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 Operating System: | hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: D353 | -------------------------------------+------------------------------------- Changes (by cmsaperstein): * differential: => D353 Comment: I've written a patch for this at https://phabricator.haskell.org/D353 (thanks to Carter for helping me with my first patch!) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9703#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9703: Add missing calling conventions to Template Haskell -------------------------------------+------------------------------------- Reporter: luite | Owner: ekmett Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.9 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 Operating System: | hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: D353 | -------------------------------------+------------------------------------- Comment (by mtolly): Just reported this a bit ago :) https://ghc.haskell.org/trac/ghc/ticket/9694 I'll close my issue and point to this one, but one extra thing I did suggest in my issue: would there be a problem in adding a flexible constructor that takes a String? Since the FFI report suggests that implementations are free to add new callconvs as necessary. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9703#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9703: Add missing calling conventions to Template Haskell -------------------------------------+------------------------------------- Reporter: luite | Owner: ekmett Type: feature | Status: patch request | Milestone: Priority: normal | Version: 7.9 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 Operating System: | hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: D353 | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9703#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9703: Add missing calling conventions to Template Haskell -------------------------------------+------------------------------------- Reporter: luite | Owner: ekmett Type: feature | Status: patch request | Milestone: Priority: normal | Version: 7.9 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 Operating System: | hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: D353 | -------------------------------------+------------------------------------- Comment (by luite): Replying to [comment:2 mtolly]:
Just reported this a bit ago :) https://ghc.haskell.org/trac/ghc/ticket/9694
Ah sorry, I missed that one. There is a workaround in GHCJS that lets you output javascript imports by encoding them with a special name, see https://github.com/ghcjs/ghcjs- ffiqq/blob/75c7ee1b09c019c897a30d87713d023e8e1fc43f/src/GHCJS/Foreign/QQ.hs#L100 . GHCJS picks this up in the desugarer and replaces it with a `javascript` import. This will probably be removed when `template-haskell` supports the calling convention directly. I'm not sure if a `String` field is all that useful, since it'd have to be possible to convert it between the TH and GHC representation. Converting might still be possible with `Read`/`Show` or similar, but that doesn't sound very attractive to me. I'd say it's better to keep the current approach until there's a real need for a flexible `String` constructor, like a non-GHC compiler supporting TH with very different calling conventions. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9703#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9703: Add missing calling conventions to Template Haskell -------------------------------------+------------------------------------- Reporter: luite | Owner: cmsaperstein Type: feature | Status: patch request | Milestone: Priority: normal | Version: 7.9 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 Operating System: | hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D353 | -------------------------------------+------------------------------------- Changes (by goldfire): * owner: ekmett => cmsaperstein * differential: D353 => Phab:D353 Comment: Let me know if you want any further assistance with this! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9703#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9703: Add missing calling conventions to Template Haskell
-------------------------------------+-------------------------------------
Reporter: luite | Owner: cmsaperstein
Type: feature | Status: patch
request | Milestone:
Priority: normal | Version: 7.9
Component: Core | Keywords:
Libraries | Architecture: Unknown/Multiple
Resolution: | Difficulty: Easy (less than 1
Operating System: | hour)
Unknown/Multiple | Blocked By:
Type of failure: | Related Tickets:
None/Unknown |
Test Case: |
Blocking: |
Differential Revisions: Phab:D353 |
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#9703: Add missing calling conventions to Template Haskell -------------------------------------+------------------------------------- Reporter: luite | Owner: cmsaperstein Type: feature | Status: closed request | Milestone: Priority: normal | Version: 7.9 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: fixed | Difficulty: Easy (less than 1 Operating System: | hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D353 | -------------------------------------+------------------------------------- Changes (by thomie): * status: patch => closed * resolution: => fixed Comment: Craig Saperstein and Luite Stegeman are shared authors for this patch. Even though the commit message says "still needs tests", they have actually been added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9703#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9703: Add missing calling conventions to Template Haskell -------------------------------------+------------------------------------- Reporter: luite | Owner: cmsaperstein Type: feature | Status: closed request | Milestone: 7.10.1 Priority: normal | Version: 7.9 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: fixed | Difficulty: Easy (less than 1 Operating System: | hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D353 | -------------------------------------+------------------------------------- Changes (by thomie): * milestone: => 7.10.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9703#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC