| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Futhark.CodeGen.Backends.SequentialWASM
Description
C code generator. This module can convert a correct ImpCode program to an equivalent C program. This C program is expected to be converted to WebAssembly, so we also produce the intended JavaScript wrapper.
Synopsis
- compileProg :: MonadFreshNames m => Text -> Prog SeqMem -> m (Warnings, (CParts, Text, [String]))
Documentation
compileProg :: MonadFreshNames m => Text -> Prog SeqMem -> m (Warnings, (CParts, Text, [String])) Source #
Compile Futhark program to wasm program (some assembly required).
The triple that is returned consists of
- Generated C code (to be passed to Emscripten).
- JavaScript wrapper code that presents a nicer interface to the
Emscripten-produced code (passed to
emccwith--extern-post-js). - The names of the C functions that must be exported from the WebAssembly module.