I'd like to add some degree of "scriptability" to a application I'm writing. Roughly speaking, I'd like a way to embed a programming language API into my program. I've looked at TinyPy, but I'm worried that - given it's small size - it might be deceptively limiting (i.e. it looks and feels like Python, but is lacking many of the features of full-fledged Python).
I'm not looking to write my own programming language; I'd like to simply take a relatively well-known language that users can write functions in, and then be able to call those functions/pass those functions parameters from my application, which will be written in C.
I'd also like to be access any data types those functions return back to me, also from within C.
Does anyone have any suggestions as to an API/Library to use, which would be both lightweight, relatively full-featured, and with a relatively easy to use or easy to understand C library?
Thanks!
Lua is a popular choice.
You might want to look at SpiderMonkey, which will allow you to embed a Javascript engine in your C program.
Most scripting languages have good interfaces with C. The ones I've actually glanced at are Perl, Python, and Lua. If your users aren't serious programmers, I'd advise giving Perl a miss. If they're serious World of Warcraft players, they might already be familiar with Lua, and writing Lua code to interface with a compiled program, so that may be a good choice.
YOu can always use 'c' with the ch toolkit.
As you said python is good especially if you can use the boost::python wrapper.
Another popular choice is Javascript, it's used by Qt's scripting system
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With