Scripting language for C/C++?

2019-02-01 10:10发布

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 for deployment?

EDIT:
Based on some commented, let me clarify the question. I should be able to convert script into C/C++ program or binary without modifying my script.

12条回答
贪生不怕死
2楼-- · 2019-02-01 10:28

You could code using D programming language as both a script or a fast compiled output.

here is an article that talks in detail about D and its advantages "The Case for D"

查看更多
Evening l夕情丶
3楼-- · 2019-02-01 10:29

With a C/C++ interpreter you can use C/C++ as a scripting language


Note: So far, I have tried only Ch and CINT. I have added ccons and UnderC to make the list more complete.

查看更多
Explosion°爆炸
4楼-- · 2019-02-01 10:30

For Python, I sometimes find psyco useful. Not sure if there is any equivalent for perl though.

When choosing a language for a task, I find it more useful to choose the language most suited for the job. If the job asks for more performance than a scripting language can provide under normal conditions, it is usually better to just switch than to bend over backwards to try to make your code fast.

查看更多
何必那么认真
5楼-- · 2019-02-01 10:36

GML : www.yoyogames.com

查看更多
爷、活的狠高调
6楼-- · 2019-02-01 10:39

Anybody interested in a scripting language that is (mostly) very similar to C++, may want to take a look at angelscript (ZLIB):

The AngelCode Scripting Library, or AngelScript as it is also known, is an extremely flexible cross-platform scripting library designed to allow applications to extend their functionality through external scripts. It has been designed from the beginning to be an easy to use component, both for the application programmer and the script writer.

Efforts have been made to let it call standard C functions and C++ methods with no need for proxy functions. The application simply registers the functions, objects, and methods that the scripts should be able to work with and nothing more has to be done with your code. The same functions used by the application internally can also be used by the scripting engine, which eliminates the need to duplicate functionality.

For the script writer the scripting language follows the widely known syntax of C/C++ (with minor changes), but without the need to worry about pointers and memory leaks. Contrary to most scripting languages, AngelScript uses the common C/C++ datatypes for more efficient communication with the host application.

For more info, check out: http://www.angelcode.com/angelscript/sdk/docs/manual/index.html

查看更多
我欲成王,谁敢阻挡
7楼-- · 2019-02-01 10:42

There is a new package Chaiscript which is designed for C++. It's relatively new and not completely stable yet.

查看更多
登录 后发表回答