OpenXTalkPaul wrote: ↑Mon Jun 03, 2024 2:30 pm
My interest in command-line xTalk interpreter has not much to do with education.
There's two use-cases I'm interest in:
1) Using xTalk the way one would write a shell script, for task automation. This was probably the instructions given to the completely separate team at Apple that wound up with AppleScript (which reads rather xTalk-like to me, although it's been said that's actually based more on Lisp under the hood). xTalk [command line] could fill a role like AppleScript
That is a great use case for people needing to automate their systems. In many cases it might be far easier than having to trawl though cryptic bash or python commands - but that's a long-term use goal (but one I'd love to see be a reality).
OpenXTalkPaul wrote: ↑Mon Jun 03, 2024 2:30 pm
2) Sort of academics research oriented (OK, that is 'Edu'), A 'playground' implementation of sorts that is a line/script-chunks interpreter, that can output text and graphics to some outlet (such as a WebView or to DOM object if running inside a web browser). Basically I'd like 'Swift Playgrounds" but xTalk or Jupyter Notebooks with xTalk support. Much the same way that you can run snippets of code in many other languages (including like Python web ASM implementation) in Jupyter Notebooks (
https://jupyter.org)
This is another interesting point, and illustrates a very important second use case for a command-line version. Not only for the education sector, but opens it up more for hobbyist use. I think that would boost popularity of the whole xTalk thing though.
OpenXTalkPaul wrote: ↑Mon Jun 03, 2024 2:30 pm
This certainly is a most important subject IMO, since at the core of our thing here is the engine(s) that turn xTalk script language into executable action on computers/devices,on as many platforms as possible, in as many ways as possible, the more the better.
That's my thinking as well.
Here's the start of a browser-based xTalk interpreter (nothing more complex than javascript and html) which can be run locally (no internet required).
Absolutely, the more the merrier.
My command-line version here is kind of middle-ground. It's not as daunting as someone might find a terminal, but it's not a full GUI with confusing amounts of distractions for a new user either. The idea is it should be a way to try out xTalk script in a minimalist GUI. I've since added light and dark theming, and customisable script syntax colours (you can save your own script colouring themes).
However, I can't implement the method to do this used in LCC (because I'm not using the revIDELibrary, as it doesn't exist) - Neither does a method to capture the result from the message box, and neither was there any type of error handling (errors would just halt the script silently with no feedback).
My newer version does pinpoint which line the error is on if a script error occurs.
- scripting.png (63.24 KiB) Viewed 938 times
However, because this doesn't use the IDE we know - it has a difference in the way script is interpreted.
For example, in the screenshot above - I have a part at the end that will generate an error on purpose. The idea was to test when an error condition is triggered.
If the day of the week ("Sunday") contains more than 7 characters (false) then the script execution tries to:
This causes an error on purpose.
However, this is only reported as an error when it runs. So you can happily run this on "wednesday" - and the condition is true, so you'd never trigger the error all day. But run it on a tuesday and you'd suddenly have a script error (intentional script error).
What I was trying to do is get my interpreter to check the logic of the script, without actually running it. Script execution is faster than in the LCC engine because of this, because it's not proof-reading each condition beforehand. This is what slows the LCC / OXT script editor down as far as I can tell. But even though my engine is faster at interpreting and running script, it may not be 'better' in this regard.
My focus with this experiment is to provide something without the distractions of a full IDE.
This is a desktop version (a C++ implementation) which I currently have working on Linux and Windows.
It's also perfectly capable of creating new stacks, saving those stacks, opening other stacks, and even drawing basic controls. Those saved stacks also open in LCC and OXT too.
I want to add line numbers at a very least, but it's just a side-project (at least I don't have to deal with window-focus errors here).