SqueakJS: A Squeak VM for the Web and Node.js
SqueakJS is an HTML5 runtime engine for [Squeak][squeak] Smalltalk written in pure JavaScript by Bert Freudenberg.
The interpreter core is divided in a number of "vm.*.js" modules, internal plugins in "vm.plugins.*.js" modules and external plugins in the "plugins" directory. The Just-in-Time compiler is optional ("jit.js") and can be easily replaced with your own.
There are a number of interfaces:
- browser: the regular HTML interface lets you use SqueakJS on your own web page. Just include "squeak.js".
- headless browser: a headless VM. It lets you use SqueakJS in your browser without a direct UI (you can create your own UI with a plugin). Include "squeak_headless.js" and add an "imageName" parameter to your website URL (eg. https://example.com/my/page.html?imageName=./example.image) or call the Javascript function "fetchImageAndRun('https://example.com/my/example.image')" to start the specified image.
- Node.js: another headless VM. It lets you use SqueakJS as a Node.js application. Just run "node squeak_node.js ".
For discussions, please use the [vm-dev mailing list][vm-dev]. Also, please visit the [project home page][homepage]!
Running it
Simplest
- [Run a minimal image][mini]. This is the simple demo included in this repo.
- Or run [Etoys][etoys]. Everything except the image and template files is in this repo.
- Or similarly, [Scratch][scratch], also in here.
Run your own Squeak image in the browser
- Drag an image from your local files into the [launcher][run].
- ... and all the other demo pages (see above) accept dropped images, too.
Run your own Squeak image from the command line
- Install a recent version of Node.js
- Run example image:
node squeak\_node.js headless/headless.image
Run an interactive shell based on WebSocket communication with Cuis image
- Install a recent version of Node.js
- Go to [ws][ws] and execute
start\_server.sh
in a first shell andstart\_client.sh
in a second shell. - After initialization it should be possible to issue Smalltalk statements which will be executed in the Smalltalk image.
- Try commands like:
Object allSubclasses size
1837468731248764723 * 321653125376153761
`Collection allSubclasses collect: [ :c