Webtalk is a web-implementation of HyperTalk. That doesn't mean you have to be online to run it. You can download it and run it from a computer with no internet connection.
What's HyperTalk?
That's another topic, which I'll expand upon a bit further down. If you never had a chance to get into the hypertalk language, you really are missing out. HyperTalk was the scripting language used in HyperCard. There's lots of ways you can experience what HyperCard was (is) today.
So what does webtalk do?
Webtalk is loosely based on the HyperTalk scripting language, and the goal is to be compatible in most major respects. There are additions to it and perhaps things missing from it. The boring bit is I'm not implying it's fit for any particular purpose, and there's no guarantees implied or otherwise about how it might run on your system. (Being based on Javascript and CSS, it heavily relies on what your browser is capable of).
The point of it is it's a programming language that's easy to type and understand.
For example, If I wanted to output the current date in javascript, I'd have to type:
Javascript Code:
const now = new Date();
const days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
const dayName = days[now.getDay()];
const dateTimeString = now.toLocaleString();
document.getElementById('datetime').textContent = `${dayName}, ${dateTimeString}`;
Javascript Result:
And although to do that in Python is simpler, it's not as readable:
Python Code:
from datetime import datetime
now = datetime.now()
formatted = now.strftime("%A, %d/%m/%Y, %H:%M:%S")
print(formatted)
Which again, gives us this:
Python Result:
Whereas, if I want to do that in HyperTalk, I'd be able to use:
Hypertalk Script:
put item 1 of the long date & "," && the date & "," && the time
Hypertalk Result:
However, the great thing about hyperTalk (and webtalk), is that it can also be quite flexible:
put item 1 of the long date & "," && dateFormat(the dateitems, "%d/%m/%Y") & "," && the time
HyperTalk script
HyperTalk was the programming language created in 1987 by Dan Winkler, and used in the HyperCard application, created by Bill Atkinson. Creating programs in HyperTalk was known as "scripting". HyperTalk scripts were much more similar to written English than many languages available at the time.
Webtalk script
A simple example of webtalk scripting:
This gives you an idea of what I'm aiming for here, to have something that is platform-agnostic which is capable of running HyperTalk scripts.
I'm trying to give a comparable set of features that were available in Hypertalk, but in Webtalk - so they are available to everyone. As such, there won't be specific Mac-only, Windows-only or Linux-only features implemented on this project. If I add a feature, it will be supported across all platforms.
Current progress:
The current documentation containing the release notes are here, as a PDF
Licensing
You might also want to read the license agreement on that last page of the documentation too.
Download
You can download a copy of webtalk, (current version), from here. You don't need anything special to run it. Just a recent browser (if you are using Safari, needs to be version 17 or above)
Wrappers
Alternatively, you can run it in a wrapper. The wrappers are larger in size because they are akin to a standalone app version. The advantage of the wrapper versions is that they also allow use of the shell (download) command in Webtalk. Note, I don't update these as often as the non-wrapper versions - purely because it's a lot of work. They get updated sporadically.
Online version
Or lastly, if you prefer, you can try it as an online live demo here. You might also want to check out the testing pages, which give you a list of commands and handlers that are currently implemented.
Overview
A project overview (text file) is also available, which covers how this all works at a quick glance.
I should really mention, you can load JSON stacks with:
load stack "" -- if it can't find the file, it will ask you
Recent additions:
See the archives (release 141-180 and 181 to 220) for earlier notes.
v221
In this version I've added the selectedText and SelectedChunk commands.
put the selectedChunk of field "myfield"
-- would return char x to y of the selected text in the field
put the selectedText of field "myfield"
-- would return the actual string of selected text in the field
I then added the put the curve command curve example-2. This can be used to plot a curve from point A to point B, and you can vary the accentuation of the curve.
I also added shape addition and subtraction for points of a graphic. As well as creating interesting shapes, this can be useful for terrain generation in games.
All of this is covered in the documentation on page 114.
v222
In this version I've added controlAtLoc(x,y) and the inverseAngle property. This is explained on page 116 of the documentation.
v223
Added the scrollBarDrag event for scrollbars:
on scrollbarDrag
put the thumbPosition of me into field "output"
end scrollbarDrag
I also added controlWithinRect:
put the controlWithinRect(myRect) into myObjects
-- returns a list of all the objects within this rect.
-- filter out undesired objects with:
filter myObjects without "*Name*"
This is handy for interactive object types, or situations where you might want to use it for games.
bubble-aimer-test.
It's now possible to hide and show groups too using:
hide group "myGroup"
-- or
show group "myGroup"
I also added physics calculation (or the start of), and added pivotPoints and massPoints. gravity-and-mass example.
Testing position and rotation via fields and variables: fix-pos-and-rot.
This is detailed on page 116 of the documentation and onwards.
v224
Added the click at command:
click at 20,20
click at the loc of button "test"
Simulates a mouse click (mousedown, then mouseup).
Added the copy and paste keyboard shortcut for objects when in edit mode.
Added an 'Align' option. You can find this when in edit mode. (Right-click on an object and you will have alignment choices):
You can now fully control menu popup buttons via script.
You can also get the HTML formatting of any field object -- try it with this table stack 2 (set to a table, then click on the 'put html' button).
Links now properly get saved in version 224 to stack JSON files, and are restored on stack open.link-test-2. No special scripting needed to make the hyperlink appear after a stack load. Testing here with multiple formatting and adding links at the same time.
Added the controlWithinObject for more accurate collision detection.
Added to the gravity-and-mass detection -- now supports colliders, collision events, and rigidbodies.
More information and specifics on page 117 of the documentation (and onwards).
v225
Added quite a bit this time around, as usual I've updated the documentation (page 119 and onwards).
Here's a live demo of changes and additions in version 225 of webtalk.
v226
Numerous improvements, and a bug fix (page 123 of the documentation).
A live demo of changes in version 226 of webtalk.
v227
A couple of bug fixes to do with text editing (page 124 of the documentation).
Added block commenting:
Expanded try-catch errors support.
Example stacks:
Live demos and tools:
User submissions: