When to use a scripting language? [closed]

0

When to use a script language and what is the ideal scenario for using it?

I have read about script languages and thought about using them in my C / C ++ server project for one game, which leads me to another question: I know it depends a lot of the chosen language, but suppose I use LuaJIT. Will I lose much in performance?

I think I'm a bit paranoid, thinking only about the application's performance and how fast it should be.

    
asked by anonymous 06.12.2016 / 23:41

1 answer

4

That's not the way to answer it, and yes, it's a little "paranoid" with performance. It should be analyzed, there should be criteria, but the concern should be in the real case.

What works best is the correct algorithm. The choice of language goes to some extent, it is obvious that a script language will never get anywhere near a low-level language, but neither is it to be so tragic. Depending on what you do, in practice it does not make much difference. It's not so easy to do, but if you do something simple on a Lua and try to do the same thing in C and wind up, C might slow down. C has lots of optimization opportunities, but it also has such a large number of bullshit.

LuaJIT performs impressively as it performs code natively, just as C would do, in most cases. But it can not compare with C which allows several optimizations that are impossible for Lua. It is true that LuaJIT can do some at runtime that C can not because it has already been compiled. You should have already read the product site in depth, if you did not, you still can not opt for it.

Even "pure" Moon still performs surprisingly well for a script language, which can even be previously compiled into a bytecode .

Anyway, there is no absolute answer to this, just having previous experience or experimenting.

You can play to see performance of each language. But beware! This is more of a joke than something to seriously consider. It is some reference, but not an absolute truth. There are a lot of factors that can give misleading results.

If you know where to apply the script and where you need the maximum performance, it can be a win-win. On the other hand, it might not need script at all.

The ideal scenario is when you need easy customization, possibly by third parties. script tends to give you more development speed by charging the app performance.

I do not know if it helps, but has more information on GameDev.SE .

    
07.12.2016 / 00:05