CodeParadise Running Smalltalk apps in a JavaScript environment

esug 35 views 11 slides Sep 19, 2024
Slide 1
Slide 1 of 11
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11

About This Presentation

Talk from ESUG 2024

"CodeParadise Running Smalltalk apps in a JavaScript environment"

PDF: http://archive.esug.org/ESUG2024/day3/04-Code-paradise.pdf


Slide Content

Erik Stel (aka ErikOnBike) - ESUG 2024 - July 10th 2024
CodeParadise
Running Smalltalk apps in a JavaScript environment

Topics
And some demos
•How it started
•Ease of development
•Implementation
•From WebApps to ServerApps
•Status

How it started
Creating WebApps with Smalltalk only
•Live programming experience in the browser
•Approach based on tiny Smalltalk image in the browser
•Most important part: DOM manipulation
•DOM elements, WebComponents and Events
•Fine grained control and performance

Ease of development
The MVP pattern
•Personal preference: thin UI/glass layer
•MVP with a Passive View
•Views are WebComponents
•Server side state
•No ‘sealing’ possible
P
M V
knows
knows

Implementation
Let’s keep it tiny
•Tiny (218kb) Smalltalk image in the browser

Client Environment
•Regular Smalltalk image on the ‘server’

Server Environment
•SqueakJS VM
•Class definitions and CompiledCode (no compiler)
•WebSockets

Architecture
Server
ServerEnvironment
ServerCommunicator
ZincWebSocketChannel
MvpWebApplication
Presenter Presenter
Client / Web Browser
ClientEnvironment (singleton)
ClientCommunicator
JavascriptWebSocketChannel
MvpWebClientBehavior
(singleton)
View
View
Server sends Messages and CompiledMethods (bytecode) to execute
Client sends Announcements

Demo
Talk is cheap

From WebApps to ServerApps
Or CLI tools
•Generic proxy mechanism
•Smalltalk Block interchangeable with JavaScript function
•Promises
•Node.js (built-in and external) modules
•Also ‘sealable’

Demo
REST assured

Status
200 / OK
•In use at

- ‘residential biologist’

- one Cycling Without Age ‘chapter’
•Room to evolve

- Documentation/examples/tests

- UI builder

- Node.js debugger

- Morph changed object (instances)

- …many more…

Questions!
Remarks?
•You can find CodeParadise at

github.com/ErikOnBike/CodeParadise
•You can find me on Discord/Slack as

ErikOnBike