All languages
Newspeak logo

Newspeak language

Bracha's live, object-capability language in the Smalltalk and Self tradition: nested classes are modules, every class name is late-bound, and the IDE runs in the browser from a serialized snapshot. Mixins, actors, and an incremental typechecker come with the platform.

Overview

Newspeak is a message-based object-oriented language in the Smalltalk and Self tradition, in which every class name is late-bound and nested classes serve as modules. The platform is an object-capability system: code, GUI, and IDE run live in the browser on a serialized snapshot.

Code

(* Workspace expressions: literals are objects, operators are sends. *)
42 + 8.                     (* 50 *)
42 / 2.                     (* 21 *)
'Goodthink' , ', friend'    (* , is a send like any other *)
3 < 4                       (* a Boolean, itself an object *)
One tab per slot: literals and binary sends; an Array filled by at:put: and folded by inject:into:; a class keeping balance_slot private behind public methods; and the module idiom, adapted from Bracha's published MovieLister example to the current Object new class form. Off the tour: late binding makes mixinApply: an ordinary send, actors speak by eventual send, and the running IDE is a live snapshot.

Distinctive traits

  • Top-level classes are modules: dependencies are constructor parameters, so there are no package imports and no global namespace.
  • Every class name is late-bound, so all classes are virtual and any class works as a mixin; mixinApply: is an ordinary send.
  • Classes nest as in BETA, and name lookup follows the lexical chain — inheritance falls out of nesting rather than being a separate mechanism.
  • Object-capability security: access control is per object, and a send with an explicit receiver only ever finds public members.
  • The typechecker is an IDE component, not part of execution: the language is deliberately dynamically typed, and typing never gates a program.
  • Activations are first-class and reflection is mirror-based, which is what the debugger, resumable exceptions, and continuations are built from.

Status

Actively developed. Primordial Soup, the current VM, targets WASM and native platforms and hosts the Hopscotch IDE as a web app. The specification is an unreleased draft (0.106); the Squeak-based implementation is unsupported. Apache 2.0 (Cadence code).

History

The design descends from Smalltalk and Self and from Bracha's earlier mixin work in Strongtalk. In May 2008 Cadence Design Systems agreed to open-source it under Apache 2.0 and a draft specification was promised; the first public prototype followed in February 2009 on a modified Squeak VM, and the self-hosted Primordial Soup VM later replaced that host.

Sources & references