The basis for an xtalk engine [I/we] control

A place to discuss any and all xTalk implementations, not just LC LCC Forks, but HyperCard, SuperCard, MetaCard, Gain Momentum, Oracle MediaTalk, OpenXION, etc.
Forum rules
Please limit any bashing/harping on any commercial interests to a minimum, thanks!
Post Reply
User avatar
OpenXTalkPaul
Posts: 2849
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: The basis for an xtalk engine [I/we] control

Post by OpenXTalkPaul »

tperry2x wrote: Sat Apr 26, 2025 3:19 pm I was in two minds about whether to contribute here anymore. As I mentioned, feel free to use the last version I gave you of webtalk (134 I think), and put it into github, or whatever you want to do with it. Rename it / rebrand it if you want.

What is currently 'webtalk', I'll continue with on my own fork over at:
https://www.tsites.co.uk/sites/other/other.php
That page will be changed with my updates.
OK, I might just do that fork since I'd prefer MIT license (although I do understand your concerns about such liberal licensing).
I'll certainly be looking forward to seeing you progress going it alone, please keep us informed when you make updates or whatever, just ignore any annoying comments (easier said than done I know) or turn comments off, or just shoot me a PM and I'll make a post about your updates that you never have to read.
Thank you very much for all the work put in already on OXT-Lite and Webtalk.
User avatar
OpenXTalkPaul
Posts: 2849
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: The basis for an xtalk engine [I/we] control

Post by OpenXTalkPaul »

You can download a copy of webtalk, (current version), from here. You don't need anything special to run it. Just a recent browser (probably NOT safari)
It works fine in Safari as far as I can tell (with the exception of Apple not supporting .ogg media formats),
Mentioning that might turn away some users that prefer Safari (or Webkit) over Chromium or Gecko based browsers.
User avatar
OpenXTalkPaul
Posts: 2849
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: The basis for an xtalk engine [I/we] control

Post by OpenXTalkPaul »

richmond62 wrote: Mon Apr 28, 2025 1:56 pm Reminds me of when they removed 'LET' from BASIC: I for one sighed a huge sigh of relief. 8-)
I can't see any synonym or abbrv. for keywords causing any bursts.
IF I was going to remove one or the other, which I have no intention of doing because it would break compatibility with scripts from one xTalk implementation or the other, then I'd remove 'return' as constant that equals the carriage-return character since 'return' is also language keyword used to return a value in functions, which forces the interpreter to have to consider which context 'return' being used in, plus 'return' is 4 more key presses to type vs. 'cr'.
User avatar
OpenXTalkPaul
Posts: 2849
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: The basis for an xtalk engine [I/we] control

Post by OpenXTalkPaul »

tperry2x wrote: Sat Apr 26, 2025 3:19 pm
OpenXTalkPaul wrote: Sat Apr 26, 2025 1:34 am put item 2 of line two of "hell,o" & cr & "wor,ld"

Doesn't work in either interpreter at the moment.
You can use:

Code: Select all

put "hell,o" & return & "wor,ld" into tString
put item 2 of line 2 of tString
Yes, my regex version is a little more restrictive, but the lexer/parser/interpreter method just grew too complex to manage.
Hopefully you take this as constructive criticism: It's not just more restrictive, it's incompatible with HyperTalk/xTalks. Neither is HyperCard simulator or Vipercard's parsing, at least when it comes to the first example I used.

I think with any implementation, the more complete it is the more the code will grow to be very complex and difficult to manage. I don't think every function/command should be a separate files, that makes for a lot of files (of course they can be re-combined later like 'webpack'). I think you might have broken the thing apart a little too much, I found it more difficult to figure out what was in which files, not knowing the names (the text guide you provided was very helpful in that regard). But if you're going to be the only developer working on it then you do whatever makes sense for you.

Would you consider adding the 'cr' as a synonym for 'return'-as-a-constant (ASCII char 10 or crlf ASCII 13 + 10 for Windows)?
tperry2x
Posts: 3533
Joined: Tue Dec 21, 2021 9:10 pm
Location: webtalk.tsites.co.uk
Contact:

Re: The basis for an xtalk engine [I/we] control

Post by tperry2x »

Yes, the version where I broke everything apart was to work with the parser, lexer, tokenizer version.
I've gone back to NOT doing that at all, for reasons I mention in the ever-changing PDF on this page.

I'll add in the cr as a synonym of return (which already exists), but my plan was to just use \n when someone uses cr in a script. The \n newline is a lot more compatible for web-based newlines it seems, with no ambiguity between different OS's and various desktop/mobile platforms.
micmac
Posts: 171
Joined: Mon Sep 13, 2021 9:46 pm
Contact:

Re: The basis for an xtalk engine [I/we] control

Post by micmac »

Hi Tom

In your webTalk:

put (5*5)
Result (5*5)

Shouldn't it be 25?

Mic
tperry2x
Posts: 3533
Joined: Tue Dec 21, 2021 9:10 pm
Location: webtalk.tsites.co.uk
Contact:

Re: The basis for an xtalk engine [I/we] control

Post by tperry2x »

micmac wrote: Sat May 03, 2025 7:45 am Hi Tom

In your webTalk:

put (5*5)
Result (5*5)

Shouldn't it be 25?

Mic
I'd set it up to use:
put the value of (5 * 5)
User avatar
richmond62
Posts: 5315
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: The basis for an xtalk engine [I/we] control

Post by richmond62 »

Hmm: judgement calls (as always).

In LiveCode/OXT both

Code: Select all

put (5*5)
and

Code: Select all

put the value of (5*5)
return 25.

The only real question here is HOW compatible webTalk should be with LC/OXT.

Certainly IFF the web version is going to be able to open stacks from MC/LC/OXT the web version ought to be able to process both of those ways of doing things.
https://richmondmathewson.owlstown.net/
tperry2x
Posts: 3533
Joined: Tue Dec 21, 2021 9:10 pm
Location: webtalk.tsites.co.uk
Contact:

Re: The basis for an xtalk engine [I/we] control

Post by tperry2x »

richmond62 wrote: Sat May 03, 2025 11:21 am ...Certainly [IF] the web version is going to be able to open stacks from MC/LC/OXT the web version ought to be able to process both of those ways of doing things.
I'm not interested in being able to open stacks from MC/LC/OXT. None of those use the JSON format that webtalk uses.
User avatar
richmond62
Posts: 5315
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: The basis for an xtalk engine [I/we] control

Post by richmond62 »

I'm not interested in being able to open stacks from MC/LC/OXT.
I wonder if other people might be interested?
https://richmondmathewson.owlstown.net/
tperry2x
Posts: 3533
Joined: Tue Dec 21, 2021 9:10 pm
Location: webtalk.tsites.co.uk
Contact:

Re: The basis for an xtalk engine [I/we] control

Post by tperry2x »

richmond62 wrote: Sat May 03, 2025 11:50 am I wonder if other people might be interested?
This is why I gave Paul a version to do what he wants with, put in GitHub, whatever he wants. He can choose a version with or without regex matching. Whatever people want to do with it. Rename it as something else (OXTjs) - it's up to him and Dan.
User avatar
richmond62
Posts: 5315
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: The basis for an xtalk engine [I/we] control

Post by richmond62 »

I have always thought that maximum cross-compatibility was the way things should be and are going . . . ever since I fell foul of a bitmap font for writing Anglo-Saxon on MacOS 7.1 would not work on Windows 3.1.

And I have always thought backward compatibility is a great strength as well: go and read Iain Banks' The Crow Road on that one. 8-)
https://richmondmathewson.owlstown.net/
tperry2x
Posts: 3533
Joined: Tue Dec 21, 2021 9:10 pm
Location: webtalk.tsites.co.uk
Contact:

Re: The basis for an xtalk engine [I/we] control

Post by tperry2x »

richmond62 wrote: Sat May 03, 2025 12:46 pm I have always thought that maximum cross-compatibility was the way things should be and are going . . .
MacOS, 32-bit, Intel depreciation, applescript depreciation, unsigned apps, non-notorized apps ... maximum cross-compatibility huh?

For the sake of a quiet life (not that I'm answerable to anyone), webtalk now processes all manner of things like:

Code: Select all

put (10 / 3.2)
put (20.2 * 9.6)

put 90 into tvar
get tvar * 3.1
put it
However, where do you stop with something like this?
Do I try and support bizarre use cases such as:

Code: Select all

put eleven + six
why only up to ten?
User avatar
richmond62
Posts: 5315
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: The basis for an xtalk engine [I/we] control

Post by richmond62 »

Numbers expressed as words seem to be one step beyond . . . the heavy, heavy monster show.
https://richmondmathewson.owlstown.net/
dandandandan
Posts: 17
Joined: Thu May 05, 2022 9:02 pm
Contact:

Re: The basis for an xtalk engine [I/we] control

Post by dandandandan »

OpenXTalkPaul wrote: Sat Apr 26, 2025 1:34 am A shame he's going back to the regex method, because Tom's Lexer/Parser version was a bit better than Dan's @dandandandan HC Sim interpreter in that it could properly return the correct value for the following example:

put item 2 of line two of "hell,o" & return & "wor,ld"
Result = "ld"

HyperCard Sim result for the same chunk expression:

Result = "
wor,ld"
(including a line break)
which is obviously incorrect.

ViperCard returns the same result as HC Sim parser
https://www.vipercard.net/0.3

I was trying to add the constant values '\n' for 'cr' (carriage 'return') and '\r' for lf (linefeed) and '\n\r' (should that be the other way around, are both ever even needed anymore?) for crlf since I've become accustomed to using those constants instead of HyperTalk's because they're shorter to type.

put item 2 of line two of "hell,o" & cr & "wor,ld"

Doesn't work in either interpreter at the moment.
The clones have matched HyperCard's behavior. Chunk expressions and other "the function of" forms operate on the next factor, not a full expression.

Dan
User avatar
OpenXTalkPaul
Posts: 2849
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: The basis for an xtalk engine [I/we] control

Post by OpenXTalkPaul »

dandandandan wrote: Wed May 07, 2025 7:13 pm The clones have matched HyperCard's behavior. Chunk expressions and other "the function of" forms operate on the next factor, not a full expression.

Dan
I was not entirely clear on what you were saying here. In my opinion a compound chunk expression, like the examples, the interpreter should combine all of the chunk expression and then treat the result as the single factor.

But to test this assertion I ran HyperCard 2.4 in MiniVMac (in a web browser port of it)

put item 2 of line two of "hell,o" & return & "wor,ld"
Result: (empty)

put item 2 of line 2 of "hell,o" & return & "wor,ld" -- no ordinal 'two' keyword used
Result: (also empty)

However when I force it to do the compound first, Please Excuse My Dear Aunt Sally style:
put item 2 of ( line 2 of "hell,o" & return & "wor,ld" )
Result:
ld (correct)

Which also works fine in HC Simulator, so that is accurate to HyperTalk (well done!).

It's been two decades since I really tried to use HyperTalk for anything so I may have forgotten that the parens were required to compound a chunk like that. I still sometimes use parens anyway, just to help myself interpret when reading back a script later.

LCS dialect xT is actually a lot more forgiving it seems (not to mention includes much more syntax and more advanced features), at least in some ways. The caveat is that you can not override a language property or keyword like the 'play' command with a custom user-script in the message path, the script will not compile, most language syntax words are reserved. HyperTalk (and at least one other: OpenXION) did allow user scripts to override keywords (which I suppose could get crazy if that's not used sparingly).

In my limited spare time, I've been building up a 'SimScript' (and actual mods to the rest of the source) that add some of the LCS xT syntax to HC Sim:
I pasted a bunch of it here, if anyone is interested (do whatever you want with it licensed :D ) :
viewtopic.php?p=14876&sid=544c042d4e092 ... e72#p14876

I'm currenty trying to bypass HC sim's need for the stack json to come from a URL or localStorage, I want to use fileReader API to load a json 'stack' from local file into the simulator. I added an "Export JSON Stack..." easy enough, but I'm having trouble loading the exported json file back into the simulator, it seems I can't just pass in the json as text, but I can't seem to get JSON.parse( jsontext) to format it back into JS array /object either.
TerryL
Posts: 144
Joined: Sat Oct 16, 2021 5:05 pm
Contact:

Re: The basis for an xtalk engine [I/we] control

Post by TerryL »

Tom Perry's WebTalk (XTalk in a browser) is online at https://www.tsites.co.uk/sites/webtalk/ ... live-demo/

I've been working with WebTalk-154. I like it, a wonderful achievement.

@ tperry. Attached is a folder with WebTalk-154 Dictionary.txt, new entries at top.
Attachments
WebTalk Dictionary.zip
(8.61 KiB) Not downloaded yet
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests