In compiled languages like Rust and C++
Implementing hot reloading in GUI development is challenging
Languages like Dart (Flutter) has hot reloading cuz it can compile JIT and AOT
Do you think Cling can help implement hot reloading easily in C++ for rapid UI development ?
Welcome to the ROOT Forum!
And sorry, but I have no idea of what you’re talking about. Can you give a concrete example?
1 Like
I have a GUI interface with ROOT-Cling-C++ and there is a window implementing a live-interpreter.
So from the terminal, I can modify the GUI in real time. Not sure if that’s what you want.
See ROOT: TGCommandPlugin Class Reference
1 Like
When you building a GUI using compiled languages like Rust, C or C++, you need to recompile the whole program every time you make some changes to the code.
This is cumbersome cuz you lose the GUI state and sometimes you need to navigate a lot to reach the part of the GUI you were working on.
In JS or Flutter (Dart) development you have hot reloading, the GUI preserves its state, only applying the changes you made to the code without recompiling the whole program.
i read that C++ has something called live++ which does the same thing but its closed source.
Discussions about hot reloading always state that compiled languages lack this feature cuz there is no “binary patching” and due to its progressive and AOT compiler nature.
I have no knowledge about this “binary patching”, but i was wondering if cling can do that thing, making hot reloading in C++ GUI development possible ?
@ferhue What i am referring to is that you edit the code in your IDE, the JIT applies those changes to the GUI without compiling the whole program. I think that’s close to what you mentioned …
Not sure, I guess it depends on what type of classes you are using for the GUI and how it interfaces with the rest of the program. I guess the best thing is to try it out. Either in cling or in clang-repl.
1 Like