| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Futhark.CodeGen.Backends.GenericWASM
Synopsis
- data CParts = CParts {}
- asLibrary :: CParts -> (Text, Text, Text)
- asExecutable :: CParts -> Text
- asServer :: CParts -> Text
- type EntryPointType = String
- data JSEntryPoint = JSEntryPoint {
- name :: String
- parameters :: [EntryPointType]
- ret :: EntryPointType
- data JSRecordField = JSRecordField {}
- data JSOpaqueType
- emccExportNames :: Manifest -> [String]
- javascriptWrapper :: [JSEntryPoint] -> [(String, JSOpaqueType)] -> Text
- extToString :: ExternalValue -> String
- opaqueToJS :: OpaqueTypes -> [(String, JSOpaqueType)]
- runServer :: Manifest -> Text
- libraryExports :: Text
Documentation
The result of compilation to C is multiple parts, which can be put together in various ways. The obvious way is to concatenate all of them, which yields a CLI program. Another is to compile the library part by itself, and use the header file to call into it.
asLibrary :: CParts -> (Text, Text, Text) Source #
Produce header, implementation, and manifest files.
asExecutable :: CParts -> Text Source #
As executable with command-line interface.
type EntryPointType = String Source #
data JSEntryPoint Source #
Constructors
| JSEntryPoint | |
Fields
| |
data JSRecordField Source #
A field in a JavaScript record opaque type.
Constructors
| JSRecordField | |
Fields
| |
data JSOpaqueType Source #
How an opaque type is represented for the JavaScript server.
Constructors
| JSOpaqueRecord [JSRecordField] | A record type with named, projectable fields. |
| JSOpaqueOther | Any other opaque type (no project support). |
emccExportNames :: Manifest -> [String] Source #
The names of the C functions that must be exported from the WebAssembly module. This is every function named in the manifest, as the server calls these directly, as well as the context management functions.
javascriptWrapper :: [JSEntryPoint] -> [(String, JSOpaqueType)] -> Text Source #
extToString :: ExternalValue -> String Source #
opaqueToJS :: OpaqueTypes -> [(String, JSOpaqueType)] Source #
Convert the opaque-type table from an ImpCode program into the JavaScript-oriented representation used by the code generator.
runServer :: Manifest -> Text Source #
Javascript code that can be appended to the generated module to run a Futhark server instance on startup.
libraryExports :: Text Source #
The names exported by the generated module.