Interchange structured data between Haskell and C

后端 未结 3 1600
囚心锁ツ
囚心锁ツ 2021-01-31 18:54

First, I\'m a Haskell beginner.

I\'m planning integrating Haskell into C for realtime game. Haskell does logic, C does rendering. To do this, I have to pass huge complex

3条回答
  •  借酒劲吻你
    2021-01-31 19:22

    hsc2hs, c→hs, and Green Card all provide automated Haskell⇆C structure peek/poke or marshalling. I would recommend their use over manually determining sizes and offsets and using pointer manipulation in Haskell, although that's possible too.

    1. Not as far as I know, if I'm understanding you correctly. Haskell doesn't have any built-in handling of foreign aggregate data structures.
    2.  
    3.  
    4. As that page describes, it's hsc2hs with some C magic.

提交回复
热议问题