Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
NewtonScript
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Features == Although NewtonScript was heavily influenced by Self, there were some differences in both the languages. Differences arose due to three perceived problems with Self. # One is that the typical Self snapshot requires 32 MB of [[Random-access memory|RAM]] to run in, whereas the Newton platform was designed to use only 128 KB for the operating system. This required some serious paring down of the engine to make it fit and still have room for applications. # Another issue was performance. Since the language would be used for the entire system, as opposed to just running on an existing operating system, it needed to run as fast as possible. # Finally, the inheritance system in the normal Self engine had a single parent object,<ref>{{Cite book|last1=Chambers|first1=C.|last2=Ungar|first2=D.|last3=Lee|first3=E.|title=Conference proceedings on Object-oriented programming systems, languages and applications - OOPSLA '89 |chapter=An efficient implementation of SELF a dynamically-typed object-oriented language based on prototypes |date=1989-01-01|location=New York, NY, USA|publisher=ACM|pages=49β70|doi=10.1145/74877.74884|isbn=978-0897913331|citeseerx=10.1.1.588.6955|s2cid=5798276 }}</ref> whereas [[Graphical user interface|GUI]]s typically have two β one for the objects and another for the GUI layout that is typically handled via the addition of a slot in some sort of GUI-hierarchy object (like [[View model|View]]). 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.<ref name=":0">{{Cite web|url=https://manuals.info.apple.com/MANUALS/1000/MA1508/en_US/NewtonScriptProgramLanguage.PDF|title=The NewtonScript Programming Language|date=1996|archiveurl=https://web.archive.org/web/20150124193723/https://manuals.info.apple.com/MANUALS/1000/MA1508/en_US/NewtonScriptProgramLanguage.PDF|archivedate=2015-01-24}}</ref> 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 memory|flash RAM]] by storing the bulk of the default data and code in the PDA's cheaper and much larger [[Read-only memory|ROM]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)