You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+22-24
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,13 @@
1
-
SqueakJS: A Squeak VM for the Web
2
-
=================================
1
+
SqueakJS: A Squeak VM for the Web and Node.js
2
+
=============================================
3
3
4
4
SqueakJS is an HTML5 runtime engine for [Squeak][squeak]</a> Smalltalk written in pure JavaScript by Bert Freudenberg.
5
5
6
-
The interpreter core is in "vm.js" and plugins are in the "plugins" directory. The Just-in-Time compiler is optional ("jit.js") and can be easily replaced with your own. There are two user interfaces: the regular HTML interface lets you use SqueakJS on your own web page. Just include "squeak.js". The other interface provides a visual debugger implemented also in JavaScript using [Lively][lively]. This does not use "squeak.js" but reimplements the UI in Lively Morphic.
6
+
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.
7
+
There are a number of interfaces:
8
+
* browser: the regular HTML interface lets you use SqueakJS on your own web page. Just include "squeak.js".
9
+
* 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.
10
+
* Node.js: another headless VM. It lets you use SqueakJS as a Node.js application. Just run "node squeak\_node.js <imagename>".
7
11
8
12
For discussions, please use the [vm-dev mailing list][vm-dev]. Also, please visit the [project home page][homepage]!
9
13
@@ -16,22 +20,33 @@ Running it
16
20
* Or similarly, [Scratch][scratch], also in here.
17
21
* Go to the [SqueakJS debugger][debug] page with the Lively interface.
18
22
19
-
**Run your own Squeak image**
23
+
**Run your own Squeak image in the browser**
20
24
21
25
* Drag an image from your local files into the [launcher][run].
22
-
* You can also drag files into the [Lively Debugger][debug] page.
23
26
* ... and all the other demo pages (see above) accept dropped images, too.
24
27
28
+
**Run your own Squeak image from the command line**
29
+
30
+
* Install a recent version of Node.js
31
+
* Run example image: `node squeak\_node.js headless/headless.image`
32
+
33
+
**Run an interactive shell based on WebSocket communication with Cuis image**
34
+
35
+
* Install a recent version of Node.js
36
+
* Go to [ws][ws] and execute `start\_server.sh` in a first shell and `start\_client.sh` in a second shell.
37
+
* After initialization it should be possible to issue Smalltalk statements which will be executed in the Smalltalk image.
38
+
* Try commands like: `Object allSubclasses size``1837468731248764723 * 321653125376153761``Collection allSubclasses collect: [ :c | c name ]`
39
+
25
40
**Which Browser**
26
41
27
42
All modern browsers should work (Chrome, Safari, IE, FireFox), though Chrome performs best currently. Safari on iPad works somewhat. YMMV.
28
43
Fixes to improve browser compatibility are highly welcome!
29
44
45
+
If your browser does not support ES6 modules try the full or headless SqueakJS VM as a single file (aka bundle) in the [dist][dist] directory.
46
+
30
47
31
48
Installing locally
32
49
------------------
33
-
**Without Lively (simpler)**
34
-
35
50
* download and unpack the [ZIP archive][zip] (or clone the [github repo][repo])
36
51
* serve the SqueakJS directory using a local web server.
37
52
@@ -44,23 +59,8 @@ Installing locally
44
59
Now Squeak should be running.
45
60
The reason for having to run from a web server is because the image is loaded with an XMLHttpRequest which does not work with a file URL. Alternatively, you could just open SqueakJS/run/index.html and drop in a local image.
46
61
47
-
**In Lively (nicer for debugging)**
48
-
49
-
* install [Lively][lively]
50
-
* inside the Lively directory, make a "users/bert" folder and put the SqueakJS directory there
51
-
* open the blank.html page using your web browser
52
-
* get a Squeak morph from the PartsBin
53
-
* save the world under a different name
54
-
55
62
How to modify it
56
63
----------------
57
-
**In Lively**
58
-
59
-
* if you installed with Lively, use that to change the code
60
-
* all changes take effect immediately
61
-
62
-
**Without Lively**
63
-
64
64
* use any text editor
65
65
* you have to reload the page for your changes to take effect
66
66
@@ -93,9 +93,7 @@ There's a gazillion exciting things to do :)
0 commit comments