Selecting An Embedded Language(选择嵌入式语言)
问题描述
我正在制作一个应用程序,该应用程序使用多种不同的算法(代理)分析一个或多个系列的数据.我想到这些代理中的每一个都可以实现为单独的 Python 脚本,我在我的应用程序中使用 Python C API 或 Boost.Python 运行这些脚本.
I'm making an application that analyses one or more series of data using several different algorithms (agents). I came to the idea that each of these agents could be implemented as separate Python scripts which I run using either the Python C API or Boost.Python in my app.
我有点担心运行时开销 TBH,因为我正在进行一些非常繁重的数据处理,我不想每次模拟都需要等待几分钟.我通常会进行数十万(如果不是数百万)次调用外部代理"的迭代;我是更好地对应用程序中的所有内容进行硬编码,还是性能下降可以容忍?
I'm a little worried about runtime overhead TBH, as I'm doing some pretty heavy duty data processing and I don't want to have to wait several minutes for each simulation. I will typically be making hundreds of thousands, if not millions, of iterations in which I invoke the external "agents"; am I better of just hardcoding everything in the app, or will the performance drop be tolerable?
另外,除了 Python 之外,我还能使用其他任何解释性语言吗?
Also, are there any other interpreted languages I can use other than Python?
推荐答案
是的,吨.Lua 和 Python 似乎是最受欢迎的:
Yes, tons. Lua and Python seems to be the most popular:
嵌入 Lua
- http://www.lua.org/pil/24.html
- https://stackoverflow.com/questions/38338/why-is-lua-thinked-a-game-language
- Lua 作为通用脚本语言?莉>
嵌入 Python
- http://docs.python.org/extending/embedding.html
嵌入 Tcl
- http://wiki.tcl.tk/3474
- http://wiki.tcl.tk/2265
嵌入 Ruby
- 如何在 C++ 中嵌入 Ruby?
嵌入 Perl
- http://perldoc.perl.org/perlembed.html
嵌入 JavaScript
- http://spiderape.sourceforge.net/
JavaScript 引擎有几十种,这只是一个例子.他们中的一些人的速度也快得惊人.
There are dozens of JavaScript engines around, this is just an example. Some of them are also frighteningly quick.
这篇关于选择嵌入式语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:选择嵌入式语言
基础教程推荐
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- CString 到 char* 2021-01-01
- 初始化列表*参数*评估顺序 2021-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
