[GHC] #9700: Support C structures in Haskell FFI

#9700: Support C structures in Haskell FFI -------------------------------------+------------------------------------- Reporter: Yuras | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Unknown | Type of failure: Blocked By: | None/Unknown Related Tickets: | Test Case: | Blocking: | Differential Revisions: Phab:D252 -------------------------------------+------------------------------------- This ticket is for tracking progress on [[CStructures]] language extension proposal. The idea is to support C structures in Haskell FFI. See wiki for details. If it will be accepted, I'm going to implement it in few steps. The first one is to support structures as return value. Platform specific part for that is already implemented, see Phab:D252 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9700 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9700: Support C structures in Haskell FFI -------------------------------------+------------------------------------- Reporter: Yuras | Owner: Yuras Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.8.3 Component: Compiler | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D252 | -------------------------------------+------------------------------------- Changes (by Yuras): * owner: => Yuras -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9700#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9700: Support C structures in Haskell FFI -------------------------------------+------------------------------------- Reporter: Yuras | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.8.3 Component: Compiler | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D252 | -------------------------------------+------------------------------------- Changes (by Yuras): * owner: Yuras => Comment: There is no chance that I'll catch 7.10 release, I'm stuck in type checker. I'm unassigning the ticket in case someone else wants to try. Probably someone with better knowledges of ghc internals will be able to finish implementation. Anyway, I have ~1 year till 7.12 to find my way into the code. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9700#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9700: Support C structures in Haskell FFI -------------------------------------+------------------------------------- Reporter: Yuras | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.8.3 Component: Compiler | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D252 | -------------------------------------+------------------------------------- Comment (by svenpanne): Hmmm, I think the wiki page is confusing C types and Haskell types: * If one wants to bind to a C structure containing int/char/float/..., one has to use CInt/CChar/CFloat/... on the Haskell side. * If one wants to access Haskell stuff containing Int/Char/Float, one has to use HsInt/HsChar/HsFloat/... on the C side. Any kind of structure marshaling can't change anything about that, there's no portable correspondence between the types in both worlds. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9700#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9700: Support C structures in Haskell FFI -------------------------------------+------------------------------------- Reporter: Yuras | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.8.3 Component: Compiler | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D252 | -------------------------------------+------------------------------------- Comment (by Yuras): carter: thank you. Unfortunately I already flushed the context out of my mind a number of days ago. But I promise to return to this feature request eventually. svenpanne: Yes, I believe you are correct. Probably it should not mention Int, Char, Float, etc at all. Feel free to fix it. Thanks for taking a look! And just for the record: I still think the low level part, covered by D252, is useful on itself. Please consider merging it into 7.10. At least I appreciate any feedback. I raised that question in a email in ghc-dev few weeks ago, but got no response. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9700#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9700: Support C structures in Haskell FFI -------------------------------------+------------------------------------- Reporter: Yuras | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D252 Wiki Page: | -------------------------------------+------------------------------------- Comment (by sboosali): any update? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9700#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9700: Support C structures in Haskell FFI -------------------------------------+------------------------------------- Reporter: Yuras | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D252 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Yuras): Replying to [comment:6 sboosali]:
any update?
I'm afraid this proposal is dead. [https://github.com/Yuras/ghc/commits /cmm-cstruct Here] is the code rebased over ghc-8.0 in case anyone wants to take it over. If you are interested to push it forward, then I'd suggest to open new [https://github.com/ghc-proposals/ghc-proposals GHC proposal]. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9700#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC