Skip to content

Commit

Permalink
Release 1.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
codefrau committed Feb 19, 2025
1 parent 902de11 commit 7a14dc1
Show file tree
Hide file tree
Showing 49 changed files with 235 additions and 206 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules/
gh-pages
dist/*.min.js*
*.code-workspace
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013-2024 Vanessa Freudenberg
Copyright (c) 2013-2025 Vanessa Freudenberg
Copyright (c) 2016 Fabio Niephaus, Google Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
SqueakJS: A Squeak VM for the Web and Node.js
=============================================

SqueakJS is an HTML5 runtime engine for [Squeak][squeak]</a> Smalltalk written in pure JavaScript. It also works for many other OpenSmalltalk-compatible images.
SqueakJS is a runtime engine for [Squeak][squeak]</a> Smalltalk written in pure JavaScript. It also works for many other OpenSmalltalk-compatible images.

Embedding a Smalltalk application in your webpage can be as simple as:

SqueakJS.runSqueak(imageUrl, canvas);

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 options to configure screen sizes etc.

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 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 <image name>".
* Node.js: another headless VM. It lets you use SqueakJS as a Node.js application via "node squeak_node.js <image name>".

For discussions, please use the [vm-dev mailing list][vm-dev]. Also, please visit the [project home page][homepage]!

Expand Down Expand Up @@ -43,7 +45,8 @@ Running it

**Which Browser**

All modern browsers should work (Chrome, Safari, IE, FireFox), though Chrome performs best currently. Safari on iPad works somewhat. YMMV.
All modern desktop browsers should work. Mobile browsers work too, but most Squeak images assume a keyboard and mouse. YMMV.

Fixes to improve browser compatibility are highly welcome!

If your browser does not support ES6 modules try the full or headless SqueakJS VM as a single file (aka bundle) in the [Distribution][dist] directory.
Expand Down Expand Up @@ -91,12 +94,14 @@ Things to work on
-----------------
SqueakJS is intended to run any Squeak image. It can already load any image from the original 1996 Squeak release to the latest Cog-Spur release, including 64-bit and Sista variants. But various pieces (primitives in various plugins) are still missing, in particular 3D graphics and networking (however, see [Croquet][jasmine] which supports both, but should be generalized). Also, we should make pre-Spur 64 bit images load. And, it would be nice to make it work on as many browsers as possible, especially on mobile touch devices.

As for optimizing I think the way to go is an optimizing JIT compiler. The current JIT is very simple and does not optimize at all. Since we can't access or manipulate the JavaScript stack, we might want that compiler to inline as much as possible, but keep the call sequence flat so we can return to the browser at any time. Even better (but potentially more complicated) is actually using the JavaScript stack, just like Eliot's Stack VM uses the C stack. I have done some [advanced JIT mockups][jit]. To make BitBlt fast, we could probably use WASM or even WebGL.
As for optimizing the way to go is an optimizing JIT compiler. The current JIT is very simple and does not optimize at all, it only eloiminates the interpreter's instruction decoding overhead. Since we can't access or manipulate the JavaScript stack, we might want that compiler to inline as much as possible, but keep the call sequence flat so we can return to the browser at any time. Even better (but potentially more complicated) is actually using the JavaScript stack, just like Eliot's Stack VM uses the C stack. I have done some [advanced JIT mockups][jit]. To make BitBlt fast, we could probably use WASM or even WebGL.

To make SqueakJS useful beyond running existing Squeak images, we should use the JavaScript bridge to write a native HTML UI which would certainly be much faster than BitBlt.
To make SqueakJS useful beyond running existing Squeak images, we should use the JavaScript bridge to write a native HTML UI which would certainly be much faster than BitBlt (Craig Latta has done some interesting work towards that in [Caffeine][caffeine]).

Better Networking would be interesting, too. The SocketPlugin currently does allows HTTP(S) requests and WebSockets. How about implementing low level Socket support based on HTTP-tunneling? The VM can run in a WebWorker. How about parallelizing the VM with WebWorkers?

Also interesting would be wrapping it in a native app, maybe via [Electron][electron] similar to [Sugarizer][sugarizer], which uses SqueakJS to run Etoys.

There's a gazillion exciting things to do :)

-- Vanessa Freudenberg (codefrau)
Expand All @@ -110,15 +115,19 @@ There's a gazillion exciting things to do :)
[etoys]: https://squeak.js.org/etoys/
[scratch]: https://squeak.js.org/scratch/
[jasmine]: https://github.com/codefrau/jasmine
[caffeine]: https://caffeine.js.org/
[jit]: https://squeak.js.org/docs/jit.md.html
[ws]: https://github.com/codefrau/SqueakJS/tree/main/ws
[dist]: https://github.com/codefrau/SqueakJS/tree/main/dist
[zip]: https://github.com/codefrau/SqueakJS/archive/main.zip
[pullreq]: https://help.github.com/articles/using-pull-requests
[electron]: https://www.electronjs.org
[sugarizer]: https://github.com/llaske/sugarizer


Changelog
---------
2025-02-19: 1.2.4 fix isAssociation for JS Bridge, optimize loading image with many objects
2024-09-28: 1.2.3 fix primitiveInputSemaphore, fix iOS keyboard
2024-06-22: 1.2.2 make copy/paste work on mobile
2024-05-27: 1.2.1 add virtual cmd button, fix touch events
Expand Down
2 changes: 1 addition & 1 deletion benchmark/benchmark.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<!--
Copyright (c) 2013-2024 Vanessa Freudenberg
Copyright (c) 2013-2025 Vanessa Freudenberg
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion benchmark/benchmark.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2024 Vanessa Freudenberg
* Copyright (c) 2013-2025 Vanessa Freudenberg
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions demo/index.html
2 changes: 1 addition & 1 deletion demo/simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<title>SqueakJS</title>
<!--
Copyright (c) 2013-2024 Vanessa Freudenberg
Copyright (c) 2013-2025 Vanessa Freudenberg
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion demo/simple.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2024 Vanessa Freudenberg
* Copyright (c) 2013-2025 Vanessa Freudenberg
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 7a14dc1

Please sign in to comment.