tperry2x wrote: ↑Fri Oct 11, 2024 12:59 pm
The title says it all really.
"The basis for a C++ xtalk engine we control".
The general gist being, you can type "get the time", which is of course xTalk script, and it'll return the current time.
output.png
So, who wants to add all the function types, definitions, handlers, commands, subroutines, and GUI on top of it?
-- okay, nobody will be rushing all at once to do that, but this merely shows how that kind of thing could be done.
Edit: I'll move the functions such as "getCurrentTime()" out of "main.cpp" into something like "functions.cpp" for easier editing.
Awesome, I'll definitely check it out when I get a minute. It would be great to have base xTalk language as a framework all set up and in a way the make it easy expand on.
One thing, shouldn't it be 'put the time' since we are putting the value to a console STDOUT? If we 'get the time' that value should go into a global 'it' or 'the result' variable.
There is also StackSmith's xTalk script interpreter component, also written in C++, which interprets the xTalk dialect called 'Hammer script". The interpreter part can be GUI-less on the command line. I believe Uli gave it a liberal license (like MIT). It's designed to allow a community to expanded on it. 'Stacksmith' uses Apple's Cocoa UI elements on macOS, but my thinking was that it could be modified to use GTK, Qt, etc. UI kits.
That's also basically what I wanted to work on doing, but for the HyperCard simulator's 'engine'. Its syntax is super easy to expand on via a user 'SimScript' section (that's editable in Browser), and that javascript built 'Engine' is relatively very small compared to our 28mb 'Emsricipten' compiled JS engine version.
I think if starting a brand new xTalk script interpreter shell from scratch, it might be better use Rust ( or 'Go' lang?) instead of C++ to write it, for the 'memory safe' quality,