-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cling based C++ as scripting language / hot code reload #31630
Comments
I just had this idea myself. I have no idea where to begin, but I'd like to be a contributor to this idea. Where might one begin with this? |
Need to decide how you want to reload C++ module in editor UI (refresh button?), game UI (refresh button?), console (command?) or network (localhost/remote), ... I propose to add UI window to godot editor where C++ modules can make changes (like add button to refresh module subsystem, create entry in top menu, etc). Can C++ module extend godot editor that way? Any links will be usefull. Note that it may be useful to reload C++ code while game is running, so need to provide API that can be used by game. Module can use some
native C++ can provide complex data structures to cling interpreter via hex pointers cling can pass data to native C++ via cling::Value result;
// ...
if(result.hasValue() && result.isValid()
&& !result.isVoid()) {
void* resOptionVoid = result.getAs<void*>();
auto resOption =
static_cast<llvm::Optional<std::string>*>(resOptionVoid);
// ...
delete resOption; /// \note frees resOptionVoid memory
// ... Note that Cling can`t refresh function / includes in plug-and-play manner. Developer have some options:
tutorials or samples? see derofim/cling-cmake#8 In theory, Cling may replace gdscript for apps that don`t provide gdscript modification to end users. Very useful if you are developing browser games (even plugins may be created with .dll or .so files, so Cling may be useful for any app), so you will be able to remove gdscript and cling from production compile step (to reduce app size and make it faster). |
Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine. The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker. If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance! (btw there's already a related proposal: godotengine/godot-proposals#573) |
cling based C++ as scripting language / hot code reload
Why? Able to run C++ script in runtime or compile it for max speed ( as in example https://github.com/derofim/cling-cmake )
Also: May be used to improve modules compile time
UPD:
In theory, Cling may replace gdscript for apps that don`t provide gdscript modification to end users. Very useful if you are developing browser games (even plugins may be created with .dll or .so files, so Cling may be useful for any app), so you will be able to remove gdscript and cling from production compile step (to reduce app size and make it faster).
The text was updated successfully, but these errors were encountered: