Realtime programing ?
-
Hi!..
See the The Fly film some days ago... i was wondering how Set Brundle did to delivery command to computer in realtime, you write an order, computer computes it instantly, ..I'm wondering if this is really possible with Qt Creator or any other classic IDE.
For instance a Window is showing at the same time as the code is being writen.
I write: QLabel qlabel = new QLabel(this);
On the window nothing visible happens...
I write: qlabel->setText(QString("Hello");
The label with "Hello" word shows on any point of the window
I write: qlabel->setGeometry(0, 0, 300, 300);
The label with "Hello" word sets its position at the top left corner.... and so.
it is just like if compiler is on guard compiling and showing result instantly..
Is it possible or just fiction ? :O
-
@U7Development
That would be the Qt & C++ interpreter, not compiler. -
Yes correct, is it possible?
-
@U7Development
I was being a bit tongue-in-cheek, not totally serious. :)For one thing, after
qlabel->setText(QString("Hello");
it wouldn't actually appear unless you had the Qt event loop running somewhere.With Python + PySide2/PyQt you can effectively type in the statements interactively, because Python is an interpreter, but as I say it won't quite behave as you describe. But you could play with it to see!
There are C++ "interpreter"s online, some serious some not, some like http://cpp.sh/ which are really compilers but are worth it for a quick test of something. Though note it won't offer you Qt!
-
@U7Development said in Realtime programing ?:
Yes correct, is it possible?
I know two C++ interpreters: there is cling, and there used to be cint.
-
I have this image in my head of a game show called: Real Time Programming!
People face off and run interpreters to solve problems.
A = announcer
A: Bob makes a bold move in Python. Shorter code yes, but execution speed may be a detriment.
A: Nancy chooses a classic, C++. She is a template wizard from Kentucky.
...
A: The competition is getting intense. Bob is writing list comprehensions like a maniac.
A: Unbelievable, Nancy has just written a recursive template. We have never seen this in a competition before! Truly an amazing feat!
A: Bobs code is struggling, but that move to "push to the internals" has really payed off.
A: It looks like however that it is all over. Nancy's template wizardry has payed off BIG!