Newspeak (programming language)


Newspeak is a programming language and platform in the tradition of Smalltalk and Self being developed by a team led by Gilad Bracha. The platform includes an integrated development environment, a graphical user interface library, and standard libraries. Starting in 2006, Cadence Design Systems funded its development and employed the main contributors, but ended funding in January 2009.

Overview

Newspeak is a class-based and message-based language. Classes may be nested, as in BETA. This is one of the key differences between Newspeak and Smalltalk.
Newspeak is distinguished by its unusual approach to modularity. The language has no global namespace. Top level classes act as module declarations. Modularity in Newspeak is based exclusively on class nesting. Module declarations are first class values and are stateless.
By design the newspeak lacks undeclared access to a global scope and therefore enforces dependency injection. As consequence it requires all class dependencies to be explicitly referenced. This makes every class in Newspeak virtual. All names of dependencies in Newspeak are late-bound, and are interpreted as message sends, as in Self.
A notable feature of newspeak is its impossibility to directly access instance variables. It's done via automatically generated getters or setters.

Development

While developed at Cadence Newspeak was used to write its own IDE, a portable GUI tool kit, an object serializer/deserializer, a parser combinator library, a regular expression package, core libraries for collections, streams, strings and files, parts of foreign function interface and CAD application code. The Newspeak platform as a whole took approximately 8 person years of work.

Identity

The name Newspeak is inspired by the Newspeak language appearing in George Orwell's dystopian novel Nineteen Eighty-Four. The heading on the programming language's website says "It's doubleplusgood". The motive for the name is that Orwell's Newspeak language grew smaller with each revision; Bracha views this as a desirable goal for a programming language.
The language icon is supposed to be Big Brother's eye, as seen in page 3 of the documentation.
It should not be confused with the safety critical programming language of the same name designed by Ian Currie of RSRE in 1984, for use with the VIPER microprocessor. Its principal characteristic was that its compiler would ensure all potential exceptional behaviour is explicitly handled by the program.

Implementation

Primordial Soup is a virtual machine that runs Newspeak binary snapshopts of serialized Newspeak files. Internal Object Representation was inspired by the Dart VM and provides basic VM primitives for the language. It can be compiled by SCons on various platforms.

Code example


" A declaration of a class Point"
class Point x: i y: j =
"Instantiation of the Point to the `p` slot inside some class"
...
public p := Point x: 42 y: 91.
...

"Hello World" example


HelloBraveNewWorld usingPlatform: platform =