Can you recommend a scripting language which allows me to easily parse "one-liner" types of scripts (they're just commands, really)?

For example, a C/C++ function which simply sets the value of a 2-dimensional vector (position, for example):

void SetVector(Vector2 &vector, float x, float y)
    vector.x = x;
    vector.y = y;

And in the scripting language, the entire script should be able to just be one line long. For example, this would be a script to set the components of vector "a" to 123.0f and 456.0f (x and y) (syntax of the language doesn't really matter, just as an example):

set_vector a 123,456 

I'd use these short scripts to do simple things like change the position of objects during runtime (for debugging or other purposes), create simple config files for all kinds of entities which would go like:


set_damage 1000
set_range 250
set_texture Data/Sprites/bomb.png


From a superficial glance, Lua, AngelScript etc. seem to be a little bit bloated for my simple needs (Although I must admit I haven't put tons of time into those two). Can you recommend something better?

  • 3
    \$\begingroup\$ LUA really is as simple as they come. Its a matter of set up, then just register your functions; your not going to really be able to avoid that anywhere. \$\endgroup\$ Commented Aug 14, 2011 at 0:41
  • 5
    \$\begingroup\$ @Daniel: Lua is not an acronym; it is a proper name. \$\endgroup\$ Commented Aug 14, 2011 at 1:03
  • 1
    \$\begingroup\$ @Nicol; Lol. (Yup, that's right, appreciate the ironic contradiction) \$\endgroup\$ Commented Aug 14, 2011 at 8:54

2 Answers 2


As far as simple, "one-liner" scripts are concerned, Lua is a perfectly legitimate choice. Function binding is easy, even with the native API (though there are plenty of helpers for this). It's syntax is pretty easy to learn. Oh, and the runtime is tiny, if that sort of thing matters to you. You won't even have to include its standard libraries, so it'll be even smaller than the compiled static library.

Lua also makes a good data-description language, much like JSON or XML.

Also, don't cut yourself short in terms of room to grow. Right now, you may only want "configuration scripts." But you'd be surprised how easily you might want logic to start creeping into those configurations. Maybe you spawn certain entities based on game state. Or change the texture of something based on game state. Whatever.

Lua can handle all of these kinds of things quite readily.

It is much easier to have too much power and not use it, than it is to have less power and then suddenly need more. Lua's power will be there if you use it, and if you don't, then you won't care. It'll still be quick and simple.

  • \$\begingroup\$ Alright, I spent the past hour taking a more thorough look at lua and it seems to be simple enough! Thanks. \$\endgroup\$
    – TravisG
    Commented Aug 14, 2011 at 14:38

I think ChaiScript would have been an even more simpler to integrate than Lua for your case. It uses a syntax more similar to C++ so it depends.


Not the answer you're looking for? Browse other questions tagged .