The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Why combining C, SDL and scripting languages?
Daniel V
Guest

What are the reasons to use a scripting language like LUA or other,
together with SDL and C code? So, for what role does people use a
scripting language like this?

Is it just to separate code, so that not every one has the full
source, or is it to save compile time, or is it to speed up
development, or are there lots of more or other reasons?

What parts of the code is best suited for being scripted?

And can you use Code to write scripts? so you can move code from one
part to another? And do any one know if there is a C compiler that
makes bytecode for a small VM?

// Daniel V.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Why combining C, SDL and scripting languages?
MrOzBarry


Joined: 26 Jun 2010
Posts: 620
Typically you would use scripting to allow the user to modify the behavior of the program without recompiling. Some examples would be NPC behavior in a game, or interface customizations.
On Oct 11, 2016 10:58 PM, "Daniel V" wrote:
Quote:
What are the reasons to use a scripting language like LUA or other,
together with SDL and C code? So, for what role does people use a
scripting language like this?

Is it just to separate code, so that not every one has the full
source, or is it to save compile time, or is it to speed up
development, or are there lots of more or other reasons?

What parts of the code is best suited for being scripted?

And can you use Code to write scripts? so you can move code from one
part to another? And do any one know if there is a C compiler that
makes bytecode for a small VM?

// Daniel V.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Why combining C, SDL and scripting languages?
markand


Joined: 11 Jun 2012
Posts: 31
Le 12 oct. 2016 4:58 AM, "Daniel V" a écrit :
Quote:

What are the reasons to use a scripting language like LUA or other,
together with SDL and C code? So, for what role does people use a
scripting language like this?
You mean Lua, it's a word not an acronym.
Quote:
Is it just to separate code, so that not every one has the full
source, or is it to save compile time, or is it to speed up
Yes, about the pros there is:
- easier deployment: you write once and run everywhere. No recompile for every platform/arch,
- quick development: no compile time, scripting language are less verbose and easier,
- security: you write your own API and provide only relevant functions. No filesystem, no system inspection.
There are some drawbacks:
- performance are always lesser,
- debugging is much harder.
Quote:
development, or are there lots of more or other reasons?

What parts of the code is best suited for being scripted?

I usually say: data. Example: maps, opponent, GUI, quests.

David.