When to use a scripting language?

Asked

Viewed 172 times

0

When to use a language of script and what is the ideal setting for its use?

I’ve been reading about languages script and I thought about the possibility of using them in my C/C++ project for a game server, which leads me to another question: I know it depends a lot on the chosen language, but suppose I use Luajit. I’ll lose a lot in performance?

I believe I’m a little paranoid, thinking only about the performance of the app and how fast it should be.

  • On languages interpreted: http://answall.com/a/22650/53279

  • @Denisrudneidesouza About what is a scripting language, I’ve read it. I would like to know when is the most appropriate time for their use and about the loss of performance. I’m not smart enough to understand the way all programmers talk, so I’m asking for something simpler to understand, because I’m really dumb.

1 answer

4


That’s not how you respond, and, yes, you’re a little "paranoid" about performance. It should be analyzed, there should be criteria, but the concern should be in the real case.

What gives most performance is the correct algorithm. The choice of language goes up to a certain point, it is obvious that a language of script It will never come close to a low-level language, but it’s not supposed to be that tragic either. Depending on what you do, in practice it doesn’t make much difference.

It’s not so easy to happen, but if you do something simple in Lua and try to do the same in C and curl up, C might slow down. C has numerous optimization opportunities, but also has such a large number to do bullshit.

Luajit has impressive performance since it runs code natively, like C would, in most cases. But it cannot compare to C that allows several optimizations that are impossible for Lua. It is quite true that Luajit can do some at runtime that C cannot because it has already been compiled. You should have read the product site in depth, if you didn’t, you should not choose it yet.

Even "pure" Lua still has a surprising performance for a language of script, which can even be previously compiled for a bytecode.

Finally, there is no absolute answer to this, only having prior experience or experiencing.

You can play to see the performance of each language. But beware! This is more 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 most performance, it can be a win-win. On the other hand, you may not need to script for nothing.

The ideal setting is for when you need customization facilitated, possibly by third parties. The script tends to give you more development speed by charging the price of application performance.

I don’t know if it helps you, but has more information on Gamedev.SE.

  • You helped too much! I keep telling myself that if the app doesn’t perform well, it won’t, but with your response, I can see how wrong I am about that. As for when to use, you clarified well the point I touched. I think it is worth using in my project. I would like to give you credit, but unfortunately I still cannot. Thank you very much for your reply.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.