Strongtalk was the 1990s Smalltalk with an optional, sound type system and a virtual machine so fast that Sun turned it into Java HotSpot. This edition re-builds it in Rust and runs it right here in the page, with nothing to install.
Types are written in angle brackets and checked separately from running the program. Untyped code is trusted, so a large program can be typed gradually, and the checker never alters what code does.
deposit: amount amount <= 0 ifTrue: [ ^self error: 'must be positive']. balance := balance + amount. history add: amount detect: aBlock self do: [:each | (aBlock value: each) ifTrue: [^each]]. ^self error: 'not found'
deposit: amount <Int> ^<Self> amount <= 0 ifTrue: [ ^self error: 'must be positive']. balance := balance + amount. history add: amount detect: aBlock <[E, ^Bool]> ^<E> self do: [:each <E> | (aBlock value: each) ifTrue: [^each]]. ^self error: 'not found'
<Int> Protocols, not classesA type names the messages an object understands, so unrelated classes that answer the same messages share a type.
<Self> Types that follow subclassesSelf and Instance types give subclasses the right result types without redeclaring a single method.
Array[E] Generics and blocksGeneric collections, union types and block types like <[Int, ^Bool]> cover real Smalltalk idioms.
Strongtalk's annotations carry straight over: <Int> becomes number,
<Self> becomes this, and control messages become plain if and for.
Translate on the web, with strongtalk --to-ts in a terminal, or with one click in the environment.
deposit: amount <Int> ^<Self>
"Add money; deposits must be positive."
amount <= 0 ifTrue: [
^self error: 'deposits must be positive'].
balance := balance + amount.
history add: amount
total ^<Int>
^history inject: 0 into: [:a :b | a + b]
/** Add money; deposits must be positive. */
deposit(amount: number): this {
if (amount <= 0) {
throw new Error('deposits must be positive');
}
this.balance = this.balance + amount;
this.history.push(amount);
return this;
}
total(): number {
return this.history.reduce((a, b) => a + b, 0);
}
The original ran only on 32-bit Windows. This one compiles the same language to bytecode and runs it natively on a Mac, or as WebAssembly in any modern browser.
The full Strongtalk syntax, type annotations included, compiled to a compact bytecode.
Activations live on the heap, so recursion can go very deep. Blocks support non-local return.
SmallInteger, LargeInteger, Float and Fraction arithmetic: 100 factorial just works.
Check a class, a method or a do-it from the browser. Errors point at the expression that failed.
on:do:, ensure:, retry, resume:, with primitives named after the original VM's.
Strongtalk's Delta define:as: chunk format, so classes travel as plain source files.
A windowed, image-style environment like the original, with the VM running in a Web Worker so an endless loop never freezes the page.
The people and ideas behind Strongtalk went on to shape the runtimes most of us use every day.
Optimizing compilers for a pure object language at Stanford and Sun.
An optional, sound type system for Smalltalk, presented at OOPSLA.
A small company builds the Strongtalk system and its adaptive VM.
Sun acquires Animorphic; the VM becomes the heart of Java.
Strongtalk is released; its team goes on to V8 and Dart.
A tour of where Strongtalk came from, how its types and VM work, and how this edition was made.
A small company, a research VM and a type system for Smalltalk, and where their ideas ended up.
Read → 02LanguageOptional types, protocols instead of classes, generics, and a checker that never changes behaviour.
Read → 03ImplementationTagged integers, inline caches, type feedback and adaptive optimization.
Read → 04This editionHow the original was studied and re-implemented, and what behaves exactly like it.
Read →One program with the terminal workspace, the type checker, the TypeScript translator and the full
environment, which strongtalk web opens in your browser, offline.
A universal installer for Apple silicon and Intel.
.pkg · .tar.gz →A setup program with Start menu entries, or a portable zip.
.exe · .zip →Static builds for x64 and arm64, as .deb or archive.
.deb · .tar.gz →macOS and Linux:
$ curl -fsSL https://volland.github.io/strongtalk/install.sh | sh
Windows (PowerShell):
> irm https://volland.github.io/strongtalk/install.ps1 | iex
With Rust installed; the website build also needs the wasm32-unknown-unknown target and wasm-bindgen 0.2.128.
$ git clone https://github.com/Volland/strongtalk $ cd strongtalk && npm run build:native $ vm/target/release/strongtalk web
The full environment opens in a second, with workspaces, class browsers and a type checker, all running locally in your browser.