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

A Tour of Architectural Abstraction with Objective-S - Wednesday, November 24th

This month, the UKSTUG will take a look at Objective-S , an architecture-oriented programming language based on Smalltalk and Objective-C, by hosting his creator Marcel Weiher. As per Alan Kay, “Code seems large and complicated for what it does” . Objective-S addresses one source of this accidental complexity: using software architectural abstraction to directly expresses the much wider variety of architectural styles typical of modern software systems, compared to traditional programming languages that still follow the call/return architectural style of scientific programs from the early days of computing. Marcel Weiher started his forays into dynamic object-oriented computing by implementing Objective-C on his Amiga 35 years ago and hasn’t stopped since. Stops on the way have been at Apple, the BBC, Microsoft and various startups, as well as contributing to Squeak. He is currently a principal software engineer at Citymapper and PhD student at HPI, where he is trying to distill some

LiveTyping - Wednesday, June 30th

 The next meeting of the UK Smalltalk User Group will be on Wednesday, June 30th.   Hernan Wilkinson will talk about his LiveTyping project. Currently, almost all mainstream dynamically typed languages support type annotation a la Strongtalk. Python calls it "type hints", TypeScript is JavaScript+type annotations, PHP calls it "type declarations" and Ruby does it through a tool called Sorbet. All of them annotate the types in the source code and it is the programmer who must write and maintain the annotation. In all cases, it is not mandatory for the system to correctly type check for it to run. LiveTyping is a type system proposal for Smalltalk, that seeks similar objectives but implemented in a different way. First, it is the environment itself that collects and maintains the types based on the execution of the system, not the programmer. Second, the types are not interleaved in the source code, thus maintaining the syntax and simplicity of the language. And fin

Deploying to the cloud from Pharo - Wednesday, July 29th

The next meeting of the UK Smalltalk User Group will be on Wednesday, July 29th. Peter Svensson will present his work on Cloudsdk-st. Cloudsdk-st is an experiment in ways to work with cloud deployment from a Smalltalk image. Traditionally cloud deployments run 'out of band' in separate build scripts or build/CI/CD systems. This project lets you define Docker images (using Dockerfiles) for Smalltalk, send them to the build system of a cloud provider directly and then choose what kind of service you want your image to be (cloud function or long-running VM). Currently it only supports Google Cloud and has a very rough UI. Future plans include support for AWS and Azure as well as better feedback and a Spec2 UI. Given the current COVID-19 restrictions, 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!