Quote:Original post by __ODIN__
While I personally use LUA (mainly for UI integration and some data-definition), I don't really consider myself an evangelist. I'm more pointing out (from having used different scripting languages, and having seen fellow professionals and some of my students alike using scripting languages), some common pitfalls.
1. The programmer, knowing C++, wants to use a scripting language similar to it.
2. However, the scripting language is often not targetting him (very often, he could do it faster in ACTUAL C++ instead)
True. I have prototyped code in script, then moved it over to C++ when I found such elements were faster to develop/debug in C++.
Quote:Original post by __ODIN__
3. The designer, who struggles with for loops, never mind multiple inheritance, wants something simple; basically some if statements and some "go here and do that" type logic.
This can be implemented in Lua, Python, Squirrel, etc., by binding the script to C++ appropriately.
Quote:Original post by __ODIN__
4. Closely mirroring C++ classes (as through straight reflection) generally leaves you open to the kind of issues scripting should hide from you (underlying class hierarchy, implementation details, crashes on invalid pointers, etc).
5. This is a personal opinion, of course, but I see Scripting as a tool that should aim to provide a safe sandbox environment at a 'higher level' (so "go to and do", rather than "pathfinding and rendering").
True, although it's important that it should be possible to implement any construct you see fit (such as full reflection if the project may benefit, or a very tightly controlled sand box-like environment). You haven't implemented your real-time raytracer or visual protein folding-program in Lua yet? [wink]
Quote:Original post by __ODIN__
Having said that; each user picks the best tradeoff for himself.. If you're a programmer working alone on a project, you might not need a scripting language at all. If you're working in a programmer heavy environment, something like Squirrel might be best for you (allowing C++ programmers to be immediatly productive). If you're working as a fascilitator for artist/designers to interact with your engine, you may go for something with a more simplified syntax, and more forgiving parser.
Again, I agree, however with respect to Lua and Squirrel as far as the script-writer is concerned, the biggest difference is syntax (they are both table-based typeless scripting languages; Squirrel directly supports classes (single inheritance), while Lua must emulate them). From experience with using Lua with LuaPlus and Squirrel with SqPlus, the later is far easier to integrate with C++, easier to write script code, and easier to debug with a visual debugger.
Since good artists/level designers have had no problem ([wink]) learning MAXScript (for 3DSMax) and MEL (for Maya), they will have no problem using Lua, Python, Squirrel, AngelScript, GameMonkey, javascript, Java, or C# (the interface-to-game-engine environment can be sandboxed/simplified as needed). <br><br>This brings us back to chosing scripting languages that are easy to integrate with C++, ease of writing script code, and ease of debugging with a good debugger (clearly C# wins here (amazing IDE/debugger, almost as fast as C++, becoming more portable (Mono, dotGNU)), however I would rank Squirrel second due to its ease of integration (easier than C#, also portable) and simpler language). Interestingly, I was surprised to see that VS2005 syntax highlights Squirrel source, and Visual Assist X further applies syntax highlighting (Squirrel source files defined as script file type). Not as nice as C# with full code completion/suggestion-lists, but cool nonetheless.