小编skv*_*rik的帖子

解析器生成器的任何基准测试?

有没有人看过解析器生成器性能的良好比较?

我特别感兴趣的是:1)用于LALR(1)语法的递归上升解析器生成器; 2)解析器生成器,它生成基于C/C++的解析器.

performance benchmarking parsing generator

8
推荐指数
1
解决办法
1273
查看次数

GHC/FFI:调用haskell模块从C导入haskell库

让我们举一个常见的例子,说明如何从C函数调用haskell函数:

Haskell模块:

{-# LANGUAGE ForeignFunctionInterface #-}

module Safe where

import Foreign.C.Types

fibonacci :: Int -> Int
fibonacci n = fibs !! n
    where fibs = 0 : 1 : zipWith (+) fibs (tail fibs)

fibonacci_hs :: CInt -> CInt
fibonacci_hs = fromIntegral . fibonacci . fromIntegral

foreign export ccall fibonacci_hs :: CInt -> CInt
Run Code Online (Sandbox Code Playgroud)

和C模块:

#include <HsFFI.h>
#ifdef __GLASGOW_HASKELL__
#include "Safe_stub.h"
extern void __stginit_Safe(void);
#endif
#include <stdio.h>

int main(int argc, char *argv[]) {
   int i;
   hs_init(&argc, &argv);
#ifdef __GLASGOW_HASKELL__
   hs_add_root(__stginit_Safe); …
Run Code Online (Sandbox Code Playgroud)

c import haskell ffi

6
推荐指数
1
解决办法
391
查看次数

regsvr32不会在注册表中创建任何条目

我在尝试注册DLL时遇到问题.我的操作系统是Windows 7(x64).

我以两种不同的方式做到这一点:

1)使用regsvr32.我收到消息"DllRegisterServer ... succeedeed",但我在注册表中找不到我的CLSID.(并且我在尝试使用此CLSID创建组件实例时出现"Class not registered"错误.)在这种情况下,我知道DllRegisterServer从未被调用(因为我在此函数的开头创建了一个文本文件而它不是创建).

2)显式加载我的DLL并调用DllRegisterServer.在这种情况下,DllRegisterServer返回S_OK,但仍然无法在注册表中找到我的CLSID并获得"Class not registered"错误.

我确定代码是正确的(因为它不能仅在我的操作系统上运行),所以似乎问题出现在操作系统中.有人遇到过这样的问题吗?

dll regsvr32 clsid

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

标签 统计

benchmarking ×1

c ×1

clsid ×1

dll ×1

ffi ×1

generator ×1

haskell ×1

import ×1

parsing ×1

performance ×1

regsvr32 ×1