Skip to main content

JsSqueak - Wednesday, December 29th

For our December meeting, Florin Mateoc will show us JsSqueak, a JavaScript implementation of (JavaScript compiled) Squeak.

Whereas SqueakJS or TruffleSqueak are implementations of the Squeak stack VM which run the Squeak bytecodes, JsSqueak compiles all the Squeak code to JavaScript (including the VM plugins), it exports the image state as one big JavaScript storeString, and then loads them, and runs the JavaScript implemented minimal VM (mostly primitives) and the JavaScript-translated Squeak methods as one combined JavaScript application. The compiled JavaScript application can be run either in a browser or in Node.js

While JavaScript, especially with its newest additions, is a very powerful language, which allows us to implement most Smalltalk-specific features (e.g. processes/green threads are implemented using generator functions and recursive yield* for all invocations, DNU is implemented using proxies and proto manipulation, the Smalltalk parallel class hierarchy is implemented using JavaScript classes with static properties and their parallel prototypes hierarchy, weak classes are implemented using JavaScript WeakRef instances in their (weak) slots), one obvious challenge is implementing contexts.
Since we compile Squeak classes to JavaScript classes, Squeak methods to JavaScript methods (and class-side Squeak methods to static JavaScript methods), the code runs on the native JavaScript call stack, and we do not have a mapping between the JavaScript function activations and reified contexts. Nevertheless, it turns out that, by providing specialized implementations for various aspects that are implemented using contexts/stack walking in Squeak, we can actually run almost all Squeak code as-is.

Florin Mateoc is an electronics engineer who has always loved programming and who has actually only ever worked as a software engineer.
Florin has worked as a professional Smalltalk programmer in Enfin (later called ObjectStudio), VisualAge, VisualWorks, and a little bit as a hobbyist in Squeak.

This will be an online meeting from home.

If you'd like to join us, please sign up in advance on the meeting's Meetup page to receive the meeting details. Don’t forget to bring your laptop and drinks!

 Update 8 January 2022: The recording of the presentation is now up on Vimeo.

Comments

Popular posts from this blog

Craig Latta - WebAssembly as a Smalltalk Compilation Target (v1) - 22 February 2023

WebAssembly (WASM) is an instruction format for portable high-performance code, run by a stack-based virtual machine. To Smalltalkers, this sounds very familiar. WASM is supported by the three most popular web browsers, and by other host platforms as well. Perhaps we can translate certain Smalltalk compiled methods to WASM, augmenting our support for physical processors and for livecoding the Web. For our February meeting, Craig Latta will describe his initial experiments, using the Epigram compilation framework. Craig Latta is a research computer scientist in Berkeley and Amsterdam, with interests including livecoding, music performance, and interactive visualization. The discovery of a mysteriously-placed copy of the Blue Book at university led to stints at several exploratory labs, and a pursuit of improvisation wherever code is found. This will be an online meeting from home. If you'd like to join us, please sign up in advance on the meeting's  Meetup page  to receive th

Vector Graphics in Cuis Smalltalk - Wednesday 31st March

The next meeting of the UK Smalltalk User Group will be on Wednesday, March 31st.   In this meeting, Juan Vuletich will present a Vector Graphic implementation in Cuis Smalltalk. Graphics for interactive software have traditionally been constrained for performance reasons. The consequence is that most software has serious trouble adapting to higher resolution screens, requires platform specific widget kits, provides limited functionality, and has sub optimal visual quality. But improvements in computing power over the last couple of decades enable a brighter future: Cuis Smalltalk provides a VectorGraphics based implementation of the Morphic UI framework that addresses all these issues. Juan Vuletich is a long standing member of the Open Source Smalltalk community. He started Cuis Smalltalk 12 years ago and has led it ever since. He has been contributing kernel code to Squeak and the Squeak VM for over 20 years. He holds an Ms.Sc. in Computer Science from the University of Buenos Air

Nov 22: Michael Lucas-Smith on Xtreams

In order to welcome Michael Lucas-Smith and Helge Nowak, who will be visiting London this month, we've moved our November monthly meeting one week earlier to Monday, November 22. Michael has offered to give us an in-depth presentation on Xtreams , a streaming framework with a new and refreshingly consistent API. From the project page: Xtreams is a generalized stream/iterator framework providing [a] simple, unified API for reading from different kinds of sources and writing into different kinds of destinations (Collections, Sockets, Files, Pipes, etc). Streams themselves can be sources or destinations as well. This allows to stack streams on top of each other. It is the stacking nature of the streams that give this framework its real power and, from what Michael and Martin (Kobetic) have shown me, you can do some pretty impressive stuff. Martin's presentation at ESUG only scratched the surface, apparently, and Michael intends to delve even deeper. There will also be plenty of ti