Search code examples
interpreted-languagecompiled-language

Why use an interpreted language to make a compiled one adjustable "on-the-fly"?


I've read about certain programs, such as the Civilization video game series, using interpreted components (Lua in this case) to interface with compiled ones (C++ I assume) to allow for user extendability through mods and such. Why is invoking a virtual machine in such a manner, when I assume you could just write and bake in your own compiled-language extensions, helpful?


Solution

  • You could totally make your own compiled extensions! But that is a lot of work, then you have to teach the users to use your programming language.

    Easier to interface with a known, stable language which is easy to interface with (like Lua).