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?
Asked
Active
Viewed 74 times
1
-
1Then the copyright of the game would be infringed. If the producer/programmer of the game allows modification of the source code by any other source it would allow for direct change to the game itself, making mods adds to the game and allows for some small change in the game dynamic itself. – David Coler Jan 01 '15 at 02:12
-
This is a good legal point that I hadn't considered, actually. – Aleksey Bilogur Jan 01 '15 at 02:18
1 Answers
2
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).

镜天花
- 46
- 1
-
So the reasoning goes that you should do it because it's less work for your end-case user if they have to work in a lightweight language like Lua, than the craziness that is C++? I don't disagree; I was wondering if there is a deeper reasoning at play. The legal issue also probably plays a part. – Aleksey Bilogur Jan 01 '15 at 02:21
-
Yes, I think so. Also this way you can strictly define your interface. That will be safer than letting users load any code they like directly into the program. – 镜天花 Jan 01 '15 at 03:18