SqueakJS

Javascript 语言实现的 Squeak VM。「A Squeak VM in Javascript」

Github stars Tracking Chart

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 and start\_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

Overview

Name With Ownercodefrau/SqueakJS
Primary LanguageJavaScript
Program languageMakefile (Language Count: 8)
PlatformLinux, Mac, Windows
License:MIT License
Release Count0
Created At2013-12-18 12:25:07
Pushed At2024-03-31 06:52:06
Last Commit At
Stargazers Count361
Watchers Count39
Fork Count74
Commits Count1.5k
Has Issues Enabled
Issues Count86
Issue Open Count28
Pull Requests Count62
Pull Requests Open Count3
Pull Requests Close Count16
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private
To the top