词条 | NewtonScript |
释义 |
|name = NewtonScript |logo = |paradigm = Prototype Object-oriented |designer = Walter Smith |developer = Apple Computer |latest release version = |latest release date = {{Start date and age|1993}} |typing = Dynamic |dialects = |influenced = Io |year = {{Start date and age|1993}} |influenced_by = Self, Dylan }}NewtonScript is a prototype-based programming language created to write programs for the Newton platform.[1] It is heavily influenced by the Self programming language, but modified to be more suited to needs of mobile and embedded devices.[2] HistoryOn August 3, 1993, Apple unveiled Apple Newton MessagePad. The device had 640 KB RAM and 4 MB ROM, running on 20 MHz Acorn RISC machine. The main intention behind Newton project, was to develop a device capable of replacing a computer while being portable.With limited battery and memory, the developers were looking for programming language capable of meeting these challenges. The developers looked at C++ language but realized that it lacked flexibility. They started focusing on prototype based languages and were impressed with Smalltalk and Self.[3] Concurrently Apple was developing another dynamic programming language called Dylan, which was a strong candidate for Newton platform.[4] However, both Self and Dylan were dropped out of consideration, as they were both in nascent stage for proper integration. Instead, a team headed by Walter R Smith, developed a new language called as NewtonScript. it was influenced by dynamic language like Smalltalk and prototype model based like Self.[3] FeaturesAlthough NewtonScript was heavily influenced by Self, there were some differences in both the languages. Differences arose due to three perceived problems with Self.
The syntax was also modified to allow a more text-based programming style, as opposed to Self's widespread use of a GUI environment for programming. This allowed Newton programs to be developed on a computer running the Toolkit, where the programs would be compiled and then downloaded to a Newton device for running. One of the advantages of NewtonScript's prototype based inheritance was reduced memory usage, a key consideration in the 128 KB Newton. The prototype of a GUI object could actually be stored in ROM, so there was no need to copy default data or functions into working memory. Unlike class based languages, where creation of an object involves memory being allocated to all of its attributes, NewtonScripts' use of prototype inheritance allowed it to allocated memory to few fields like _proto and _parent instead of creating whole new object. Here, _proto and _parent signifies whether the object is using prototype or parent inheritance.[6] An example to illustrate above concept, a developer might create a new button instance. If the button uses the default font, accessing its font "slot" (i.e., property or member variable) will return a value that is actually stored in ROM; the button instance in RAM does not have a value in its own font slot, so the prototype inheritance chain is followed until a value is found. If the developer then changes the button's font, setting its font slot to a new value will override the prototype; this override value is stored in RAM. NewtonScript's "differential inheritance" therefore made efficient use of the Newton's expensive flash RAM by storing the bulk of the default data and code in the PDA's cheaper and much larger ROM. Important termsViews: They are objects created by Newton View System, which are created on run-time to render views. Template: It is a blueprint from which views are created. Protos: They can be blueprint for a template or a view, and are elements of NewtonScript code libraries. Frame and Slot: Frame is a dynamic collection of slots, and one element of fram is called as a slot. A slot is made up of name and value. The value can be of any type. It is worthwhile to note that all objects in NewtonScript are frames.[7]Soup and Entry: It is a related collection of frames/ data. Entry is an individual frame in a soup. Frame Heap: RAM allocated dynamically by NewtonScript. Base View: It is the main view of application, consisting of all the variables and methods used in the application. Advantages and DisadvantagesAdvantages
InfluencesWith the cancellation of Newton project by Apple in 1998,[8] all further mainstream developments on NewtonScript were stopped. However, the features used in NewtonScript would continue to inspire other programming models and languages. The prototype-based object model of Self and NewtonScript was used in JavaScript, the most popular and visible language to use the concept so far. NewtonScript is also one of the conceptual ancestors (together with Smalltalk, Self, Act1, Lisp and Lua) of a general-purpose programming language called Io[9] which implements the same differential inheritance model, which was used in NewtonScript to conserve memory. See also
References1. ^{{Cite book|last=Smith|first=W. R.|date=1994-02-01|title=The Newton application architecture|url=http://ieeexplore.ieee.org/lpdocs/epic03/wrapper.htm?arnumber=282931|journal=Compcon Spring '94, Digest of Papers.|pages=156–161|doi=10.1109/CMPCON.1994.282931|isbn=978-0-8186-5380-3}} 2. ^1 {{Cite web|url=http://www.cc.gatech.edu/~schoedl/projects/NewtonScript/ |title=The NewtonScript Programming Language |last=Schödl |first=Arno |date=2004-10-10 |website= |access-date=2016-09-15 |deadurl=bot: unknown |archiveurl=https://web.archive.org/web/20041010175535/http://www.cc.gatech.edu/~schoedl/projects/NewtonScript/ |archivedate=2004-10-10 |df= }} 3. ^1 {{Cite book|last=Smith|first=Walter R.|date=1995-01-01|title=Using a Prototype-based Language for User Interface: The Newton Project's Experience|journal=Proceedings of the Tenth Annual Conference on Object-oriented Programming Systems, Languages, and Applications|series=OOPSLA '95|location=New York, NY, USA|publisher=ACM|pages=61–72|doi=10.1145/217838.217844|isbn=978-0897917032}} 4. ^{{Cite web|url=http://www.cise.ufl.edu/~jnw/Marlais/OODL.html|title=Dylan: An Object Oriented Dynamic Language|website=www.cise.ufl.edu|access-date=2016-09-22}} 5. ^{{Cite book|last=Chambers|first=C.|last2=Ungar|first2=D.|last3=Lee|first3=E.|date=1989-01-01|title=An Efficient Implementation of SELF a Dynamically-typed Object-oriented Language Based on Prototypes|journal=Conference Proceedings on Object-oriented Programming Systems, Languages and Applications|series=OOPSLA '89|location=New York, NY, USA|publisher=ACM|pages=49–70|doi=10.1145/74877.74884|isbn=978-0897913331|citeseerx=10.1.1.588.6955}} 6. ^1 {{Cite web|url=https://manuals.info.apple.com/MANUALS/1000/MA1508/en_US/NewtonScriptProgramLanguage.PDF|title=The NewtonScript Programming Language|last=|first=|date={{date|1996}}|website=|access-date={{Date}}}} 7. ^{{Cite book|title=Programming for the Newton®: Software Development with NewtonscriptTM|last=McKeehan|first=Julie|last2=Rhodes|first2=Neil|publisher=AP Professional|year=1994|isbn=978-0-12-484800-9|location=955 Massachusetts Avenue, Cambridge, Massachusetts 02139|pages=|via=}} 8. ^{{Cite web|url=http://windowsitpro.com/windows-server/apple-cancels-newton|title=Apple cancels Newton|website=windowsitpro.com|access-date=2016-09-22|date=1998-02-28}} 9. ^{{Cite web|url=http://iolanguage.org/guide/guide.html|title=io guide|website=iolanguage.org|access-date=2016-09-15}} External links
4 : Apple Newton|Prototype-based programming languages|Dynamically typed programming languages|Scripting languages |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。