在高级语言使用静态/共享C库 [英] Using Static/Shared C Libraries in Higher Level Languages

查看:106
本文介绍了在高级语言使用静态/共享C库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道是否有某种方式把我的自定义共享/静态库,在C制成,并用它们到另一个更高的语言如Python或Node.js的。

I'm wondering if there is some way to take my custom shared/static libraries, made in C, and use them into another higher language such as python or node.js.

我来到这一点,因为我在写一些库来计算一些数学的东西。我听说不是重计算的那么好Node.js的(但对网络I / O)。

I came with this because I'm writing a few libraries to calculate some math stuff. I heard about node.js not being so good for heavy calculations (but is for networking I/O).

所以,我真的想上花费找到一种方法,使到的NodeJS用我的C库智能方法一段时间。我的意思是,我要让委派的NodeJS重计算,C,并获得答案回来不知何故。

Hence, I'm really thinking on spend some time in find a way to make nodejs to use my C libraries in smart way. I mean, I want to make nodejs delegate the heavy calculations to C, and get the answers back somehow.

但我接受关于使用其他一些高层次的语言(或工具)的任何好的建议,没有工作。任何情况下,而不是那些我说会AP preciated。

But I'm accepting any good advice about using some other higher level languages (or tools) that does the job. Any scenario rather than those I said will be appreciated.

编辑:

我刚刚发现的this在计算器那得到了我的attetion问题。我来试试现在。

I Just Found this question in stackoverflow that got my attetion. I'll try it for now.

推荐答案

有没有很多情况下,你会想这样做。我最近测试了一些沉重的数学计算在我的电脑和嵌入式Linux系统上的继起的 https://github.com/derekmolloy/exploringBB/tree/master/chp05/performance 。而且我发现它的Node.js在短短的时间C两倍的工作++(优化)开。因此,这可能不值得的。

There are not many cases where you would want to do that. I recently tested some heavy math calculations on my pc and on an embedded linux system following Derek Molloy's code from https://github.com/derekmolloy/exploringBB/tree/master/chp05/performance . And I found out node.js does the job in just twice the time C++ (optimized) takes. So this may not be worth your while.

这篇关于在高级语言使用静态/共享C库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆