Newt Introduction

Contents:

Introduction

Newt allows you to developing applications using NewtonScript, run and test it, and save it as a package directly on your Newton.

NewtonScript (NS), Newton's built-in, object-oriented (o-o) language, shares ancestry with dynamic o-o languages like Smalltalk, Self, Common Lisp, and ObjectLogo. NewtonScript is the same language that is used by Apple's Newton ToolKit (NTK). For more advanced users, familiarity with o-o concepts and constructs would be useful; for others, Newt should serve as a brief introduction to these ideas. There is some information on NewtonScript here, and more in the Newt manual (available to registered users).

Newt 1.0, the first version of Newt, was a turtle-graphics environment (this is available now via an optional NewtDraw plug-in.

Newt 2.0 introduced rudimentary capabilities to create dynamic views and stand-alone applications that could later be run or transferred using "RUNewt" [a run-time module -- no longer needed]. Users interested in building applications could consider Newt a portable prototyper, or as a learning step toward building more complex, complete and industrial-strength applications via NTK on Macintosh (and eventually Windows).

Newt 3.0 provided the ability to create real packages directly on the Newton. Newt 3.2 was NOS (Newton OS) 2.x compatible. Newt 3.4 is the latest version.

Newt in the News

Newt 1.0 received an early positive review in the first issue of the (now defunct) DoubleTap newsletter. "Building Native Newton Applications with Newt" appeared in PDA Developers (formerly PIE Developers), Vol. 2.4, July 1994; pp.14-18. This has been revised as the NewtATut tutorial. Erica Sadun reviewed Newt's turtle personality in the same issue. _protoReality 1.3 -- the NANUG newsletter, available as a Newton book -- features an interview about Newt. _protoReality 1.3 & 1.4 have articles with my daughter on using Newt to draw letters.

"Newt" is often used by the monosyllable-challenged to refer to a Newton. "Newt is neat" could refer to the Newton itself and/or to this wonderful application -- I will always mean the latter. Show Newt to your friends to help achieve the worldwide goal of "Newt on every Newt"! So that Newt can appeal to many families and orientations, it is gender "newtral" (in order to reproduce more Newts, however, it has not been "newtered"); users should probably not call themselves "Newtists".

In other literary references, there is of course Shakespeare's famous drink recipe: "eye of newt, ...". For crossword puzzle fans, "eft" is an old term for "newt". Newts have hatched aboard the space shuttle -- "one small step for a newt, a giant leap for newtkind". Tabloids will probably suggest a connection between Newt and Elvis. This is likely, given Elvis' early career as a "lounge lizard". However, the FBI has conspiratorially censored this from the latest Newton ROMs [in early Newtons, you could set the Country field of your Personal Preferences to Graceland, though this "Easter Egg" could later interfere with dialing. A picture of a newt reappeared briefly whenever you woke up your Newton. Other wakeup pictures can be obtained by adding two or three spaces after your Address]. You should discount any tabloid allegations suggesting any relation between Newt, football great Knute Rockne, Newt, Wayne Newton, Olivia Newton-John, Newton Minnow, or last, but not least, U.S. Speaker of the House Newt Gingrich.

For Further Info

Since I provide little description of Newton syntax, other functions, or curriculum ideas in this introductory file, I strongly recommend that you stay reasonably close to the examples that I provide, register Newt to obtain a more detailed manual and sample sources. Take a look at the NewATut and NewtTurT pages/Newton books, which are interactive tutorials. Newt FAQ list other books and sources.

Programming WARNING -- Newt and You

Exploring "mathematics microworlds" and doing problem solving by writing programs are "powerful ideas" (Seymour Papert) and require some active participation by you the learner -- taking risks and making mistakes. For example, Newt allows you to execute arbitrary NewtonScript expressions. This can be a formula for enlightenment or disaster. So, remember that this is your Newton with your information and listen to your mother's advice about backing up your system and hanging out with strange functions.

Using common sense in following examples and suggestions, and limiting yourself to documented commands, you should reap many benefits and long hours of enjoyment from using Newt. At the same time, "a little learning [about programming] is a dangerous thing" (with apologies to Alexander Pope). I would caution against experimenting with random functions or methods. "Gee, I wonder what xxx does" might yield a simple error box, or it might zap a frame or soup in your system. You can also ask me if you're not sure.

At the same time, given the litigious nature of our society that yearns for risk without responsibility, I feel compelled to add the following warning (repeated in other variations several places later):

>>> Warning: Use Newt at your own risk! <<<

NewtonScript

Syntax

If you have already tried the examples and expressions outlined in under Exploring Application or Turtle, looked at the examples applic0.nwt, applic2.nwt and graphic0.nwt, then you should have a rough idea of what NewtonScript (NS) syntax is like and several of Newt's commands. In NS, programs or scripts are defined as methods on objects. Methods describe an object's behavior or actions. Objects in NS are called frames (perhaps they should have been called newtrons), which inherit attributes and behavior from other frames, usually called prototypes. Newt is a prototype or kind of view. You tell Newt to do things by sending it a message, e.g., go. This message consists of a frame (Newt implicitly), a colon (:) separator, the method name, and parentheses with zero or more parameters (values for variables) separated by commas. For example, :go(50). A frame also has slots (named attributes) that contain values that you can access, such as times, dist, and deg. You can just use the slot name if it can be found via inheritance, or frame.slot if you want to be more specific.

Warning: If you use other system frames, methods, and functions beyond the ones I have described here, in manual and in example files, you do so at your own risk.

For further information on NewtonScript syntax and view frame slots and methods, NTK from APDA includes manuals, and other books will be published. The Newt Manual provides a summary of syntax and built-in functions, along with additional Newt methods for registered users.

Errors

In the unlikely event that an error occurs during Eval or Save, Newt pops up a helpful error message and/or cryptic code. You can add another plug-in (ErrCnst) that provides even more error message.

Things to try: check your syntax against those in examples, check spelling for method and variable names, missing or extra punctuation or values, garbage from stray gestures, check number and type of arguments (e.g., float vs. integer), and in general use your "newtle". If you think it is really a problem with Newt, send me mail describing what you had entered, and I will try to respond asap.

The 80+ page (Acrobat) manual (evolving toward HTML) provides basic coverage of NewtonScript syntax and many built-in functions. It also documents methods for creating applications, customizing Newt, drawing with it, and accessing other system functionality. Description and examples of specific system prototypes are provided in separate example files.

Personal History

I first implemented a screen turtle on an IMLAC display computer, accessed from BBN Logo on a DEC PDP-10 at Stanford circa 1973. Subsequently, I implemented other versions in Lisp, and used others in Smalltalk and ObjectLogo. My long-time interests in children, learning and programming environments, plus two small NTK examples, Dot2Dot and InspectorGadget, with a little creative juxtaposition, started me down this path. Experience with using and implementing object-oriented browsers and toolkits in Smalltalk and Lisp and numerous user requests led to the Newt 2.x/3.x enhancements to support application development.

Credits

Newt 3.4 was developed with NTK 1.6; some parts (plug-ins) of Newt were developed with Newt itself. Newton® and Newton ToolKit® are trademarks of Apple Computer. Kudos to Apple for creating an exciting product (Newton), and powerful object-oriented language (NewtonScript) and development environment (NTK). I look forward to new versions of NTK, documentation and examples. Original manual created with FrameMaker 4.0 (from Adobe (formerly Frame Technology); electronic version with Acrobat 2.0 (from Adobe), and various Newtonbook versions using Newt's Cape.

My family contributed the evening and weekend time for me to explore this; Ellie and Kristina helped with testing, Maria with proofreading. Finally, thanks to the users and testers who have given me feedback and encouragement. I hope that Newt can continue to evolve into an environment that meets your needs.


Version 3.4. Last updated: Jan 1999