Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selecting An Embedded Language

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?

like image 256
Rune Aamodt Avatar asked Jan 20 '10 18:01

Rune Aamodt


1 Answers

Yes, tons. Lua and Python seems to be the most popular:

Embedding Lua

  • http://www.lua.org/pil/24.html
  • https://stackoverflow.com/questions/38338/why-is-lua-considered-a-game-language
  • Lua as a general-purpose scripting language?

Embedding Python

  • http://docs.python.org/extending/embedding.html

Embedding Tcl

  • http://wiki.tcl.tk/3474
  • http://wiki.tcl.tk/2265

Embedding Ruby

  • How to embed Ruby in C++?

Embed Perl

  • http://perldoc.perl.org/perlembed.html

Embed JavaScript

  • http://spiderape.sourceforge.net/

There are dozens of JavaScript engines around, this is just an example. Some of them are also frighteningly quick.

like image 80
6 revs, 3 users 80% Avatar answered Oct 01 '22 12:10

6 revs, 3 users 80%