Paradigm | object-oriented, functional |
---|---|
Family | Smalltalk: Self |
Designed by | Gilad Bracha |
Developers | Gilad Bracha, Peter von der Ahé, Vassili Bykov, Yaron Kashai, Ryan Macnak, William Maddox, Eliot Miranda |
First appeared | 2006 |
Stable release | Prototype / February 2013 |
Typing discipline | dynamic, optional |
Implementation language | C++, Newspeak, JavaScript |
OS | Windows 10, macOS, Linux, Android; web browsers |
License | Apache |
Website | newspeaklanguage |
Major implementations | |
Primordial Soup | |
Influenced by | |
Smalltalk, Self, BETA, E |
Newspeak is a programming language and platform in the tradition of Smalltalk and Self being developed by a team led by Gilad Bracha. [1] The platform includes an integrated development environment (IDE), a graphical user interface (GUI) library, and standard libraries. [2] Starting in 2006, Cadence Design Systems funded its development and employed the main contributors, but ended funding in January 2009. [3]
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. [4] The language has no global namespace. Top level classes act as module declarations. Modularity in Newspeak is based exclusively on class nesting. [1] Module declarations are first class values (i.e., they may be stored in variables, passed as parameters, returned from methods, etc.) 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 (instance variables referred as by "slots") to be explicitly referenced. This makes every class in Newspeak virtual. [1] All names of dependencies in Newspeak are late-bound (dynamically 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. [1] : 3
While developed at Cadence Newspeak was used to write its own IDE (compiler, debugger, class browsers, object inspectors, unit testing framework, a mirror based reflection API etc.), 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. [5] The Newspeak platform as a whole took approximately 8 person years of work. [1] : 17
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; [6] 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. [7] [8]
Primordial Soup is a virtual machine (VM) that runs Newspeak binary snapshopts of serialized Newspeak files. [9] Internal Object Representation was inspired by the Dart VM and provides basic VM primitives for the language. [9] It can be compiled by SCons on various platforms.
" A declaration of a class Point"classPointx:iy:j=(" This section is the instance initializer"|"slots declarations are always between bars"publicx::=i." ::= denotes slot initialization of a mutable slot"publicy::=j.|)("A method"publicprintString=(ˆ’x=’,xprintString,’y=’,yprintString))"Instantiation of the Point to the `p` slot inside some class"...publicp:=Pointx:42y:91....
HelloBraveNewWorldusingPlatform:platform=(platformTranscriptopenshow:'Hello, Oh Brave new world'.)
A "Hello, World!" program is generally a simple computer program that emits to the screen a message similar to "Hello, World!". A small piece of code in most general-purpose programming languages, this program is used to illustrate a language's basic syntax. A "Hello, World!" program is often the first written by a student of a new programming language, but such a program can also be used as a sanity check to ensure that the computer software intended to compile or run source code is correctly installed, and that its operator understands how to use it.
Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let programmers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need to recompile. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the underlying computer architecture. The syntax of Java is similar to C and C++, but has fewer low-level facilities than either of them. The Java runtime provides dynamic capabilities that are typically not available in traditional compiled languages.
Smalltalk is a purely object oriented programming language (OOP) that was originally created in the 1970s for educational use, specifically for constructionist learning, but later found use in business. It was created at Xerox PARC by Learning Research Group (LRG) scientists, including Alan Kay, Dan Ingalls, Adele Goldberg, Ted Kaehler, Diana Merry, and Scott Wallace.
Squeak is an object-oriented, class-based, and reflective programming language. It was derived from Smalltalk-80 by a group that included some of Smalltalk-80's original developers, initially at Apple Computer, then at Walt Disney Imagineering, where it was intended for use in internal Disney projects. The group later was supported by HP Labs, SAP, and most recently, Y Combinator.
Lua is a lightweight, high-level, multi-paradigm programming language designed mainly for embedded use in applications. Lua is cross-platform software, since the interpreter of compiled bytecode is written in ANSI C, and Lua has a relatively simple C application programming interface (API) to embed it into applications.
Self is a general-purpose, high-level, object-oriented programming language based on the concept of prototypes. Self began as a dialect of Smalltalk, being dynamically typed and using just-in-time compilation (JIT) with the prototype-based approach to objects: it was first used as an experimental test system for language design in the 1980s and 1990s. In 2006, Self was still being developed as part of the Klein project, which was a Self virtual machine written fully in Self. The latest version, 2024.1 was released in August 2024.
In programming languages, a closure, also lexical closure or function closure, is a technique for implementing lexically scoped name binding in a language with first-class functions. Operationally, a closure is a record storing a function together with an environment. The environment is a mapping associating each free variable of the function with the value or reference to which the name was bound when the closure was created. Unlike a plain function, a closure allows the function to access those captured variables through the closure's copies of their values or references, even when the function is invoked outside their scope.
Bytecode is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references that encode the result of compiler parsing and performing semantic analysis of things like type, scope, and nesting depths of program objects.
In computer science, reflective programming or reflection is the ability of a process to examine, introspect, and modify its own structure and behavior.
Modular programming is a software design technique that emphasizes separating the functionality of a program into independent, interchangeable modules, such that each contains everything necessary to execute only one aspect or "concern" of the desired functionality.
IP Pascal is an implementation of the Pascal programming language using the IP portability platform, a multiple machine, operating system and language implementation system. It implements the language "Pascaline", and has passed the Pascal Validation Suite.
A Java package organizes Java classes into namespaces, providing a unique namespace for each type it contains. Classes in the same package can access each other's package-private and protected members.
The Java class loader, part of the Java Runtime Environment, dynamically loads Java classes into the Java Virtual Machine. Usually classes are only loaded on demand. The virtual machine will only load the class files required for executing the program. The Java run time system does not need to know about files and file systems as this is delegated to the class loader.
Generics are a facility of generic programming that were added to the Java programming language in 2004 within version J2SE 5.0. They were designed to extend Java's type system to allow "a type or method to operate on objects of various types while providing compile-time type safety". The aspect compile-time type safety required that parametrically polymorphic functions are not implemented in the Java virtual machine, since type safety is impossible in this case.
Pharo is a cross-platform implementation of the classic Smalltalk-80 programming language and runtime system. It is based on the OpenSmalltalk virtual machine (VM) named Cog, which evaluates a dynamic, reflective, and object-oriented programming language with a syntax closely resembling Smalltalk-80. It is free and open-source software, released under a mix of MIT, and Apache 2 licenses.
Gilad Bracha is a software engineer at F5 Networks, and formerly at Google, where he was on the Dart programming language team. He is creator of the Newspeak language, and co-author of the second and third editions of the Java Language Specification, and a major contributor to the second edition of the Java Virtual Machine Specification.
Nemerle is a general-purpose, high-level, statically typed programming language designed for platforms using the Common Language Infrastructure (.NET/Mono). It offers functional, object-oriented, aspect-oriented, reflective and imperative features. It has a simple C#-like syntax and a powerful metaprogramming system.
Dart is a programming language designed by Lars Bak and Kasper Lund and developed by Google. It can be used to develop web and mobile apps as well as server and desktop applications.
Objective-C is a high-level general-purpose, object-oriented programming language that adds Smalltalk-style message passing (messaging) to the C programming language. Originally developed by Brad Cox and Tom Love in the early 1980s, it was selected by NeXT for its NeXTSTEP operating system. Due to Apple macOS’s direct lineage from NeXTSTEP, Objective-C was the standard language used, supported, and promoted by Apple for developing macOS and iOS applications from 1997, when Apple purchased NeXT until the introduction of the Swift language in 2014.