Weakly or strongly typed scripting language?



  • There are lots of scripting languages available; those I like are Lua, JavaScipt, Angelscript and Chaiscript.
    The first two (Lua and Javascript) are weakly typed, which means there is not much strict syntax and script developing might be faster. However, Lua lacks "C++ support", so you cannot export your C++ objects and methods directly to it (you may do so with proxies and additional headache and code). JavaScript looks more straightforward, but I haven't been able to compile Google's V8 engine and most alternatives simply don't look quite attractive.
    The last two (Angelscript and Chaiscript) are strongly typed which might not be very pleasant for developing into for most people (I personally don't mind, or even prefer strong typed languages). On the up side they are built with C++ in mind, exporting C++ objects to the script is as simple as "done", and performance is not bad at all.

    Keeping in mind that I would like to use a scripting language for developing a plugin system where each plugin will also be developed by beginner or unexperienced programmers, do you think it would make a huge difference choosing a strongly or a weakly typed language? Would developers run away from developing plugins just because of this?


  • Moderators

    [quote author="T3STY" date="1424406473"]JavaScript looks more straightforward, but I haven't been able to compile Google's V8 engine and most alternatives simply don't look quite attractive.[/quote]Have you seen Qt's "QJSEngine":http://doc.qt.io/qt-5/qjsengine.html ?

    [quote author="T3STY" date="1424406473"]do you think it would make a huge difference choosing a strongly or a weakly typed language? Would developers run away from developing plugins just because of this?[/quote]Interesting question! You should survey your potential users, as personal preferences in this area can be quite varied.

    Here's one case study: When Google wrote the VoltAir game, they said that JavaScript helped them work more efficiently (but bear in mind that this is partially because JavaScript is integrated into QML): http://google.github.io/VoltAir/doc/main/html/index.html#16



  • I didn't know about QJSEngine, How could I miss it?

    Yeah, I should question potential users. But now that I found QJSEngine I will first check it.

    Thank you very much for your help!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.