问题描述
我正在制作一个应用程序,使用几种不同的算法(代理)分析一个或多个数据系列。我认为每个代理都可以实现为单独的Python脚本,我使用Python C API或Boost.Python在我的应用程序中运行。
我有一点担心运行时开销TBH,因为我做一些非常重的数据处理,我不想等待几分钟的每个模拟。我通常会做出数十万,如果不是百万的迭代,其中我调用外部代理;我更好只是硬编码的应用程序中的一切,或性能下降是否可以忍受?
此外,还有其他任何解释语言,我可以使用不同于Python吗?
是的,吨。 Lua和Python似乎是最受欢迎的:
嵌入Lua
嵌入Python
嵌入Tcl
嵌入Ruby
嵌入Perl
嵌入JavaScript
- a href =http://spiderape.sourceforge.net/ =nofollow> http://spiderape.sourceforge.net/
有几十个JavaScript引擎,这只是一个例子。其中一些也吓人的快。
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.
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?
Also, are there any other interpreted languages I can use other than Python?
Yes, tons. Lua and Python seems to be the most popular:
Embedding Lua
- http://www.lua.org/pil/24.html
- Why is Lua considered a game language?
- Lua as a general-purpose scripting language?
Embedding Python
Embedding Tcl
Embedding Ruby
Embed Perl
Embed JavaScript
There are dozens of JavaScript engines around, this is just an example. Some of them are also frighteningly quick.
这篇关于选择嵌入语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!