Steve Weyer's Newt FAQ

Recent changes:

This answers some Frequently Asked Questions about Newt, the native Newton development environment. This is same content as the usual FAQ text, but with references to a separate page for information about current releases. As time permits, I plan to revise this FAQ to correspond to new versions of Newt, and to clarify old & new user questions.

Contents

What's new?

Newt 3.3

For further details, see documentation on main NewtDevEnv page or revision history.

What is "Newt"? Newt Icon

Newt (aka NewtDevEnv) is an environment for developing applications using NewtonScript and saving as packages directly on your Newton. (You can also use a PC, Mac or Unix system to edit source code and transfer and debug via terminal emulator).

Keywords: object-oriented programming, application development environment, NewtonScript, NTK.

History. Like a chameleon, Newt has evolved to provide different functionality to different users. The first version of Newt in Oct. '93, inspired by the Inspector Gadget and Dot2Dot examples from Apple, allowed you to draw graphics using NewtonScript -- the turtle, its amphibious cousin and name inspiration, used Logo. You, the learner, could use Newt to explore mathematics via a turtle microworld, or add NewtonScript methods to emulate Logo commands and data structures.

With enthusiastic feedback from early users, successive versions allowed you to create objects based on Newton interface prototypes and save as an application. Newt's application icon reflects both its original turtle personality as well as its later, and more dominant, application personality.

What is NewtonScript?

NewtonScript is Newton's built-in, object-oriented (o-o) language. NewtonScript (NS) shares ancestry with dynamic o-o languages like Smalltalk, Self, Common Lisp, and ObjectLogo. NewtonScript code is compiled into bytecodes and interpreted on the Newton. Although NewtonScript is fast enough for most applications (especially on NOS 2.0), a RISC compiler in NTK 1.5 can be used to dramatically speed up selected NewtonScript methods (though making them much larger in the process). For more advanced users, familiarity with o-o concepts and constructs would be useful; for others, Newt could provide an introduction to these ideas.

How does Newt compare to NTK (Apple's Newton ToolKit)?

Like NTK from APDA*, Newt uses NewtonScript to define objects and methods. NTK provides an excellent (and the only) framework for building large, complex, industrial-strength applications. However, NTK requires a heavy investment in terms of software, hardware and training -- making it difficult and expensive for PC-based developers, students or developer-wanna-bes to find out more about, and actually do, Newton development. Unlike NTK, you do not need a Macintosh and $$$ in order to develop Newton applications using Newt.

*You can also call APDA at 1-800-282-2732 (U.S.), 1-800-637-0029 (Canada), or 716-871-6555 (international).

With Newt, you can develop applications directly on your Newton, or develop them in a text editor on a PC, Unix workstation or Macintosh. You can copy the text into NCK, or use use a desktop terminal emulator to transfer the source text using Slurpee and also to debug. NTK runs only on Macs (68030 and above); NTK for Windows is in beta.

Newt is shareware and costs $49.50**; NTK 1.6 is currently $295 (including BookMaker). Support for Newt is currently free; support for NTK costs $250/year and up. However, as a one person effort, Newt does not have as much documentation and as many features as NTK. See later questions for further discussion of Newt's current features and limitations.

**for credit card (via Register), SWREG (on Compuserve), or foreign checks; $45 for checks in US$. Students: ask me about an educational discount.

What are other Newton development alternatives?

Windows NTK
late-1996?
Newton Forms/Data Collection Tools
NewtNews lists the following tools (in addition to NTK, Newt, Newt's Cape): AppGen, FieldWorker, Flash-Data, FormLogic, Gaia Forms, Informed Filler, Leverage, NewtDb, NS Basic, PowerForms, transForm,
WinNewt
Windows front-end for Newt
BookMaker
a pre-processor for NTK to create Newton books from text files (it comes with NTK).
Paperback
for Mac and Windows can be used to create simple book-like applications (free).
Newton Press
creates simple books on Mac (or Windows) APDA ($69).
Newt
can be used to create books programmatically, but I would not recommend it for books.
Newt's Cape
an application creates Newton books with text, graphics, links, tables and forms from HTML (HyperText Markup Language) documents -- same format as used in WWW (World Wide Web) browsers).
Books
Programming for the Newton (McKeehan&Rhodes, Academic Press, ISBN: 0-12-484800-1) is a book that discusses in-depth a single application example ($30); it comes with a demo version of NTK (for the Mac), but does not provide a general reference.
Wireless for the Newton (McKeehan&Rhodes, Academic Press, ISBN: 0-12-484801-X)
Programming For The Newton Using Macintosh 2nd Edition $34.95, AP Professional, ISBN: 0-12-484832-X [AP Professional, 1300 Boylston St., Chestnut Hill, MA 02167; 800 313-1277]
Newton Programming Guide, $44.95, Addison-Wesley, ISBN: 0201479478
Newton Human Interface Guidelines, $24.95, Addison-Wesley, ISBN: 0201488388

How do I create and run a Newt application?

You create an application from source text that is stored in a Notepad folder, e.g., Business. The source text contains object definitions for your application, and methods to add to Newt itself for use in development. Once you have built an application in Newt, you run and test it directly in Newt.

From Newt, you can save an application as a package using the NewtPack plug-in, and then run it from Extras, use package utilities to archive it, or back it up to the desktop with NCK and then use an ExtractPackage utility.

The Newt Application Tutorial (NewtATut) book (current release) demonstrates this basic application development process.

Can I create any kind of application using Newt?

Basically, yes, if you have enough documentation, frame heap, and perseverance. You may also need to structure your application and adapt NTK examples somewhat to fit Newt's style and to work around Newton system limitations. Newt has been tested extensively with 190+ examples, including versions of most of the DTS (Apple Developer Technical Support) examples, and other publicly available source examples. A few examples:

What's the difference between a Newt application and an NTK package?

Since Newt 3.0, there is no difference (as far as I can tell) between a Newt and a NTK-generated package. Both reside in a special area known as package memory. When you open your application, the package uses some dynamic memory -- also known as frame heap -- for run-time state (the "view"); however, much of the application (the "template") remains in read-only package memory.

During development, Newt creates an application entirely in dynamic memory, except for references to built-in (ROM) objects. During the save process, Newt copies the application into package memory.

What is "RUNewt"?

In earlier versions of Newt (pre-3.0, and for 3.0 users of pre-1.3 ROM OMP (Original Message Pads), RUNewt could be used to save Newt applications in a soup. You could later run these applications with RUNewt, or beam/mail them to other users. It served as an installer (for Newt applications), launcher (similar to Extras) and a run-time library (for "platform functions"). RUNewt is no longer needed/supported since NewtPack works even on OMP (at least for "small" applications).

How large an application can I build with Newt?

Newt can currently construct most of the DTS (Developer Technical Support) examples that come with NTK and many others (see examples.txt). However, since applications mostly reside entirely in heap when they are constructed (or later run with RUNewt), you may eventually see the dreaded "Newton does not have enough memory to do what you want now. Do you want to Restart?" (or Exception |evt.ex.outofmem|: (-48216) Ran out of Frames Heap memory).

Hopefully, newer revisions of the Newton system software and hardware will allocate more space for frame heap and manage it more effectively. You can also use package utilities to reduce the number of packages that you have installed. Newt 3.1 handles heap better and allows larger applications to be developed and saved as packages.

Practically, the maximum for a regular application (entirely in heap) would be ~50K. However, if certain objects are obtained from other packages (e.g., PlatFunc) or from soups via special techniques (e.g., library packages; guitune.nwt), packages can be much larger -- over 100K.

How can I transfer a Newt-generated application to another user?

There are two formats for an application:

Source

You can transfer the source from the Notepad by emailing or beaming directly to another Newton, or by transferring the text to a desktop text file via Newton Connection Kit or Slurpee. The other Newton user can then build and compile the application from the NewtonScript source using Newt.

Package(Binary)

You can beam a Newt-generated package to another Newton (for 1.x, use a third-party utilities such as BeamPkg or ScrollEx). You can do a backup to your desktop computer using Newon Connection Kit, then use a Mac or Windows ExtractPackage utility to copy the package from the backup file, and then give this to someone else on a floppy, send as an email attachment, or upload to an information server/service. For NOS 2.0, use Package Buddy, X-Port or Newton Package Uploader.

How do I access Newt-created applications via the Extras drawer?

With Newt 3.1, normal ("form") packages appear in Extras automatically when they are saved and installed. If you have "autoparts", these are patches or plug-ins that do not appear in Extras (except in NOS 2.0 "Extensions"). Newt can also save books (created programmatically); Newt's Cape can also save books. Newt will add the ability to create other kinds of packages (font parts, store parts,...) as these are documented (and there is demand).

Which system prototypes and platform functions are available?

Newt currently includes and documents 59 common system prototypes and viewclasses (all those documented in NTK) for 1.x (and another 140+ protos for NOS 2.0). User prototypes are an economical way to define your own version of a system prototype with your own default and additional slots and methods, and use it in several places in your application. You can also include objects that contain other views, e.g., an NTK "linked layout". Finally, you can use other objects in the ROM or in other applications (e.g., the Life 1.4 example borrows native code methods).

"Platform functions" are additional functions (like RegisterCardSoup) that are not built-in to the Newton ROMs, but are normally included as needed by NTK. All of the platform functions are provided by the PlatFunc plug-in and can be used by a Newt application.

How do I include graphics and sound resources?

With Slurpee, you can transfer hexadecimal strings that represent bitmap, PICT, sound and IR remote control code resources -- these can be copied directly from ResEdit. After you upload these to a "Bitmaps", "Sound" or "IRCD" soup, your application can access these at definition or at run-time. All of the DTS examples involving graphics, sound and IR have been built, saved and run successfully. However, there are some size constraints, especially for sounds, due to heap limitations (see How large an application can I build with Newt?). There may be other 3rd party solutions appearing that will assist in the conversion and transfer of graphic resources. For example, the Newt's Cape Graphic Converter can convert GIF, PICT and BMP graphics files for transfer to the Newton.

How do I debug programs with Newt?

As you add objects to your application in Newt, you can test objects and behaviors incrementally. In addition, you can use Newt with NTK's Inspector or with Slurpee as a remote debugging tool to evaluate and print expressions interactively via the keyboard, or programmatically Print values and errors. Newt does not currently support more advanced features such as trace or breakloop.

What is Slurpee anyway?

(Slurpee has been mentioned in several earlier answers). Although Slurpee is not required for Newt, it is a very convenient companion tool that can be used in conjunction with a desktop terminal emulator to:

Slurpee is free to registered Newt users, it's $10 shareware for others; (current Slurpee release).

Are there other development differences between Newt and NTK?

Newt does not currently provide a layout editor or object browser like NTK -- instead, objects are organized hierarchically via "pathnames" and represented textually. Newt does not provide constants as generally as NTK: it provides development-time constants for "Evaluate" slots, and a limited form of "DefConst". Most compile-time functions from NTK can be accessed in Newt via built-in or user-defined methods.

On the plus side, since development is incremental, you can test the behavior and layout of an application immediately and more accurately without having to go through a complete build and upload cycle. You can also test install and remove scripts interactively. It is very easy to add "helpBooks" with Newt (see NewtATut example); for NTK, this costs another $195 (for BookMaker) and it is cumbersome. It may even be easier to build and re-use user prototypes and "linked layouts" in Newt compared to NTK. Newt's "declare" mechanism for naming children is simpler. NTK has some separate constructs such as "afterScripts" that Newt finesses.

With version 1.5, NTK provides profiling -- this can be useful for determining bottlenecks in an application. It also provides for native RISC compilation -- this can provide significant speedup (though at a much larger size) for selected methods that primarily do primitive integer and array operations. Although Newt cannot currently compile to native code, it can use existing native code, e.g., from a "code library" such as Life.

Who should be a Newt user?

Newt is appropriate if you want to learn about NewtonScript programming and Newton application development, if you would like to build and distribute small to moderate-sized applications, or if you want to do some portable prototyping or lack a Macintosh or money for development. Since Newt complements NTK, some Newt users are also using or considering NTK. Newt's turtle personality can provide a portable learning environment for children. Current world-wide Newt users include PC developers, university students, professors, financial traders,....

What's next for Newt?

Newt could evolve in many possible directions: more examples, more documentation, non-programmatic application interfaces, support for application-specific development like database forms, integration with other Newton applications -- as with most shareware, how Newt will evolve depends greatly on the feedback and level of support from users.

As you can see, I am experimenting with distributing documentation and examples via the Web, Acrobat & Gopher (in addition to floppies).

Where can I find Newt?

Here is latest public version of Newt

What other Newt-related files/packages/info are available?

Short descriptions and latest file URLs may be found on the current releases page for:

Why should I register?

If you've thought about doing Newton development with NTK, and are unsure if you still want to spend $295 (reduced from $795), plus perhaps buy a high-end Mac or PC, Newt is an inexpensive, compatible way to start learning about NewtonScript, prototype objects and the Newton system. Even if you have NTK (or the demo), Newt can provide new perspectives and examples for (portable) Newton programming.

Newt is fully functional for many applications, but its public documentation is minimal and includes only a few examples. Registered users can download* files via http(web) or ftp for the latest versions of packages, additional development plug-ins (listed in plugins.txt), 200+ source examples (listed in examples.htm), and a 80+ page manual** (Acrobat format) describing Newt features and NewtonScript syntax and functions.

As a registered user, you also receive additional packages (Slurpee, beta and native versions of Newt, NewtPack), other information (Q&A documents, tutorials), patches for bugs (though there aren't many), notification about upcoming releases and examples, priority in answers to questions, and feedback on your applications (as time permits). Finally, registration encourages me to continue development of Newt and other shareware packages, and provides immediate relief for you of the insidious "shareware procrastination guilt syndrome".

*File Formats (& Floppies): Although downloading is recommended (you access the most recent files more quickly, and I save time also), you can receive files on Mac (Stuffit format) or DOS (Zip format) floppies if you choose. I assume you already have a decompression utility (StuffitExpander on Mac; PKUNZIP on PC) that can handle archive passwords; for online use, your utility needs to be able to handle .sit.hqx or .zip encoding.

**Electronic Documentation: Since the documentation is rapidly growing and changing, it has become impractical to provide a paper manual currently. Documentation is available initially as Acrobat files (with bookmarks, hypertext links; searchable; printable); also as PostScript files (for printing). I will be creating HTML versions of the documentation and Newton Books (using Newt's Cape from HTML). In the future, if there's enough demand, a paper manual might be available for an additional charge; other specific formats like Microsoft Word and DocViewer are not likely since Acrobat, HTML and NewtonBooks should be more useful, common and portable.

When you register, I email* you the location and password for the current "registered" files. If you do not have convenient http/ftp access (or have trouble downloading), you can opt instead for floppies. If floppies, I need to know:

*Email: If you provide me your preferred email address, it's easier for me to clarify options with you, and keep you informed about upcoming releases, examples, etc. If you're registered and have not heard from me in awhile, or you change your email address, please send me email (weyer@netaxs.com -- preferred).

How can I register?

See the general registration info or current Newt registration info for a text form and more information about these options. To register, you can

For $11 (SWREG, Register) (or $10 check in US$), currently registered Newt users can upgrade to receive latest releases, examples and manual.


Last updated: 24 Nov 96


Steve Weyer - weyer@netaxs.com