tweag / asterius

DEPRECATED in favor of ghc wasm backend, see https://www.tweag.io/blog/2022-11-22-wasm-backend-merged-in-ghc
1.98k stars 57 forks source link

Support linking with compiled C files #314

Open hsyl20 opened 5 years ago

hsyl20 commented 5 years ago

Support for linking with compiled C files would be very useful:

Options:

  1. write a c-to-cmm compiler

    • Pro: integrate well into the existing Asterius pipeline
    • Con: hard to get right
    • Con: lot of work to support the full C language
  2. Use LLVM (Clang) to compile into Wasm

  3. Compile LLVM-IR into Cmm?

    • Pro: already working toolchain for C, C++, etc.
    • Pro: Integrate well into the existing Asterius pipeline
hsyl20 commented 5 years ago

Note that it would be good to share the approach we use with GHCJS.

lemmih commented 4 years ago

As the author of a few packages with c-sources, I'm interested in seeing how this turns out.