选择嵌入语言 [英] Selecting An Embedded Language

查看:93
本文介绍了选择嵌入语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个应用程序,使用几种不同的算法(代理)分析一个或多个数据系列。我认为每个代理都可以实现为单独的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

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.

这篇关于选择嵌入语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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