Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Newspeak (programming language)

From Wikipedia, the free encyclopedia
Not to be confused withNewspeak, a language spoken in the novel Nineteen Eighty-Four.
Programming language
Newspeak
Paradigmobject-oriented,functional
FamilySmalltalk:Self
Designed byGilad Bracha
DevelopersGilad Bracha, Peter von der Ahé, Vassili Bykov, Yaron Kashai, Ryan Macnak, William Maddox, Eliot Miranda
First appeared2006; 19 years ago (2006)
Stable release
Prototype / February 2013; 12 years ago (2013-02)
Typing disciplinedynamic,optional
Implementation languageC++, Newspeak,JavaScript
OSWindows 10,macOS,Linux,Android;web browsers
LicenseApache
Websitenewspeaklanguage.org
Majorimplementations
Primordial Soup
Influenced by
Smalltalk,Self,BETA,E

Newspeak is aprogramming language andplatform in the tradition ofSmalltalk andSelf being developed by a team led byGilad Bracha.[1] The platform includes anintegrated development environment (IDE), agraphical 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]

Overview

[edit]

Newspeak is aclass-based andmessage-based language. Classes may be nested, as inBETA. 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 enforcesdependency injection. As consequence it requires all class dependencies (instance variables referred as by "slots") to be explicitly referenced. This makes every class in Newspeakvirtual.[1] All names of dependencies in Newspeak arelate-bound (dynamically bound), and are interpreted asmessage sends, as in Self.

A notable feature of newspeak is its impossibility to directly access instance variables. It's done via automatically generated getters orsetters.[1]: 3 

Development

[edit]

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 offoreign function interface and CAD application code.[5] The Newspeak platform as a whole took approximately 8 person years of work.[1]: 17 

Identity

[edit]

The nameNewspeak is inspired by theNewspeak language appearing inGeorge Orwell's dystopian novelNineteen Eighty-Four. The heading on the programming language's website says "It'sdoubleplusgood". 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 beBig 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 ofRSRE in 1984, for use with theVIPER microprocessor. Its principal characteristic was that its compiler would ensure all potential exceptional behaviour is explicitly handled by the program.[7][8]

Implementation

[edit]

Primordial Soup is avirtual machine (VM) that runs Newspeak binary snapshopts of serialized Newspeak files.[9] Internal Object Representation was inspired by theDart VM and provides basic VM primitives for the language.[9] It can be compiled bySCons on various platforms.

Code example

[edit]
" 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....

"Hello World" example

[edit]

"Hello, World!" program:

HelloBraveNewWorldusingPlatform:platform=(platformTranscriptopenshow:'Hello, Oh Brave new world'.)

See also

[edit]

References

[edit]
  1. ^abcdeBracha, Gilad; von der Ah´, Peter; Bykov, Vassili; Kashai, Yaron; Maddox, William; Miranda, Eliot (June 2010)."Modules as Objects in Newspeak"(PDF).
  2. ^Gilad Bracha, Peter Ahe, Vassil Bykov, Yaron Kashai and Eliot Miranda. The Newspeak Programming Platform.
  3. ^Bracha, Gilad (2008-11-24)."Room 101: We have Good news, and we have Bad news".Room 101: A place to be (re)educated in Newspeak. Google Blogger. Retrieved2009-09-21.
  4. ^Gilad Bracha, Peter Ahe, Vassili Bykov, Yaron Kashai, William Maddox and Eliot Miranda. Modules as Objects in Newspeak. In the Proceedings of the 24th European Conference on Object Oriented Programming, Maribor, Slovenia, June 21–25, 2010.
  5. ^Bracha, Gilad; Von der Ah, Peter; Bykov, Vassili; Kashai, Yaron; Maddox, William; Miranda, Eliot (May 6, 2008)."The Newspeak Programming Platform". Cadence Design Systems – via ResearchGate.
  6. ^Software Engineering Radio Episode 140: Newspeak and Pluggable Types With Gilad Bracha/
  7. ^Currie, I.F. (July 1986). "NewSpeak: an unexceptional language".Software Engineering Journal.1 (4):170–176.doi:10.1049/sej.1986.0027.ISSN 0268-6961.
  8. ^Cullyer, W.J. (2012-12-06)."Implementing Safety Critical Systems: The VIPER Micropocessor". In Birtwistle, Graham; Subrahmanyam, P. A. (eds.).VLSI Specification, Verification and Synthesis. Springer Publishing. pp. 16–17.ISBN 978-1461320074.
  9. ^abPrimordial Soup, Ministry of Truth, 2021-12-19, retrieved2023-05-11

External links

[edit]
Smalltalk programming language
Software
Implementations
Major
Dialects
Virtual realityplatforms
Graphical user interfaces
Workstation
Community
Business
People
Designers
  • Italics= discontinued
  • ° =Open-source software
    BookCategory
  • Retrieved from "https://en.wikipedia.org/w/index.php?title=Newspeak_(programming_language)&oldid=1267522562"
    Categories:
    Hidden categories:

    [8]ページ先頭

    ©2009-2025 Movatter.jp