Scripting language for C/C++?

后端 未结 12 1860
礼貌的吻别
礼貌的吻别 2020-12-25 07:56

Is there a scripting language for C++ (like perl) which can be used for rapid development and use some tool which can convert into C/C++ program to get higher performance f

12条回答
  •  南笙
    南笙 (楼主)
    2020-12-25 08:41

    The question could be interpreted different ways...

    If you have already coded a part of your application in C++ and need to add modules or scripts, that you want to add in the C++ code eventually for improved performance, you could use Qt which is a solid, very complete multi-platform framework.

    It includes support for scripts (ECMAScript, the standardized version of Javascript), from which you can access your C++ objects if you need to. It also provides support for plug-ins.

    With that approach, you can even proceed in three steps,

    • first do some tests in Javascript,
    • then code the base of your application in C++ and still use a part in scripts (for example if you need to try different algorithms),
    • and finally port everything, or at least the critical parts, in C++.

    Another option is to embed a Python interpreter in your code, although that will probably require more work.

提交回复
热议问题