相关疑难解决方法(0)

Haskell FFI/C的性能考虑?

如果使用Haskell作为我的C程序调用的,那么调用它会对性能产生什么影响?例如,如果我有一个20kB数据的问题世界数据集,我想运行如下:

// Go through my 1000 actors and have them make a decision based on
// HaskellCode() function, which is compiled Haskell I'm accessing through
// the FFI.  As an argument, send in the SAME 20kB of data to EACH of these
// function calls, and some actor specific data
// The 20kB constant data defines the environment and the actor specific
// data could be their personality or state
for(i = 0; i < 1000; …
Run Code Online (Sandbox Code Playgroud)

parallel-processing performance haskell ffi

28
推荐指数
2
解决办法
3302
查看次数

如何通过FFI从包含数据类型的haskell导出函数

我能够通过包含标准数据类型的FFI导出简单的haskell函数.但是,我不知道如何导出采用标准数据类型以外的数据类型的函数.

例如

data SomeType a = SomeType a
data SomeOtherType b = SomeOtherType b

doSomething:: SomeType a -> SomeOtherType b
Run Code Online (Sandbox Code Playgroud)

如何导出函数doSomething?

现有文件谈到了非常简单的例子.

haskell ffi

5
推荐指数
1
解决办法
349
查看次数

标签 统计

ffi ×2

haskell ×2

parallel-processing ×1

performance ×1