1

there are a nice binding of script system for Qt, which uses javascript. With metaobjects built in qt it gives a big power for a programmer.

I'm rewriting game from another libraries with using Qt. Now I want to replace python script system with something faster. I dunno whether built-in Qt scripts are quite fast for my purposes? Or QLua would be better choise for my case?

Any numbers/statistic is appreciated, thanks.

4
  • What language are the other libraries written in? Commented Sep 20, 2011 at 22:15
  • @cbamber85 they are written with c++ Commented Sep 21, 2011 at 14:46
  • Why do you want scripting support? If you're writing a game surely performance is critical, so why not stick to C++ - the libraries native language. Commented Sep 21, 2011 at 16:05
  • @cbamber85 In game development there is a plenty places where object logic code are more like configuration. I have bad times migrating from python to JS, and mostly it was easier to put that code to C++. Also QML is very usefull and it is built over JS. However having more than one scripting languge is very confusing and that's why we decided to put python away. Commented Nov 15, 2011 at 22:32

1 Answer 1

1

This article on QtScript in 4.6 discusses the improvements in performance in QtScript in 4.6 over 4.5, it states:

Qt 4.6′s QtScript implementation is based on WebKit’s JavaScript engine, JavaScriptCore (you might’ve also heard it being referred to as “SquirrelFish” or “SquirrelFish Extreme”).

Another article discusses the technologies in SquirrelFish Extreme, which include:

  • Bytecode Optimizations
  • Polymorphic Inline Cache
  • Context Threaded JIT
  • Regular Expression JIT

If you need full native code performance, but want to allow the system to be extended, you may want to look into How to Create Qt Plugins, you could even use the Qt plugin system to write plugins that run JavaScript, Lua or Python to extend the system.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.