Newt-faq.txt (newt-devenv-faq-32.txt) 1/1/96 S. Weyer This answers some "frequently asked questions" about Newt, the native Newton development environment. It recycles, updates and augments information that is found with the current versions of the Newt package (see "Where do I find Newt?") and NewtATut book, an interactive Newt Application Tutorial (see "What other Newt-related packages are available?"). I will revise this faq to correspond to new versions of Newt, and to clarify old & new user questions. This FAQ is available in the "usual places -- see "Where can I find Newt?" as [newt-devenv-faq-32.sit/.hqx/.zip] [CIS: nwtfaq.sit/.zip], browse my web page: http://www.netaxs.com/~weyer/newton/releases.html or send me email: weyer@netaxs.com ----- Contents: - What's new? - What is "Newt"? - What is NewtonScript? - How does Newt compare to NTK (Apple's Newton ToolKit)? - What are other Newton development alternatives? - How do I create and run a Newt application? - Can I create any kind of application using Newt? - What's the difference between a Newt application and an NTK package? - What is RUNewt? - How large an application can I build with Newt? - How can I transfer a Newt-generated application to another user? - How do I access Newt-created applications via the Extras drawer? - Which system prototypes and platform functions are available? - How do I include graphics and sound resources? - How do I debug programs with Newt? - What is Slurpee anyway? - Are there other development differences between Newt and NTK? - Who should be a Newt user? - What's next for Newt? - Where can I find Newt? - What other Newt-related packages are available? - Is there other Newt information available? - Why should I register? - How can I register? ----- What's new? This has been updated to reflect changes in Newt 3.2 and Slurpee 1.7. Changes include: Newt 3.2: - NOS (Newton OS) 2.0 compatible (Newt and plug-ins) - adds NTK Inspector (if installed) to overview list - adds Delete animation for Delete, Delete All - bug fixes for :doObj, :addView, :getNamedResource, Notify redefinition, misc. - uses builtin popup scrollers (instead of NEXT>) for NOS 2.0 - Newt no longer converts symbols in the viewClass and _proto slots, so it is time to get rid of those ' so the symbols will be looked up as constants. Slurpee 1.7 - Newton OS (NOS) 2.0-compatible - last array in an entrySpec can be variable length (last type repeated as necessary) - for Notes, last ----- before BYE! no longer required; empty paragraphs ignored correctly - reverts to old protoEndPoint (as defined in Platform Functions 1.1), so Slurpee should work on all MessagePad models [Slurpee 1.6 failed on some] - adds REPLACE! command for replacing entries in soups (especially handy for graphics) - DUMP! command now looks at value of labels for non-Notes, e.g., Names only in Business folder: - shortened buffer lengths to be more heap-friendly for lines longer than 1000 characters (5K for data lines), use continuations \ - bitmaps wider than 32 were not handled properly For a complete description, see the change files accompanying each package. For latest information and versions, check my web page: http://www.netaxs.com/~weyer/newton/releases.html ----- What is "Newt"? Newt (aka NewtDevEnv) is an environment for developing applications using NewtonScript and saving as packages directly on your Newton. 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, 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. 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 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.5 is currently $295 (BookMaker is an additional $195). 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? A Windows version of NTK should appear in 1996. "Programming for the Newton" by McKeehan&Rhodes (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. A newer book, "Wireless for the Newton" by McKeehan&Rhodes (ISBN: 0-12-484801-X, is also available. A version of Basic (NS Basic) runs directly on the Newton and translates Basic commands into NewtonScript ($99; info@nsbasic.com; http://www.io.com/user/nsbasic/index.html). For book applications, BookMaker is a pre-processor for NTK for creating Newton books from text files -- it currently costs $195 and requires NTK. Paperback for Mac and Windows can be used to create simple (single font) book-like applications (free). Newton Press is a new product (in beta) that can create simple books on Mac or Windows ($69). It is possible to create books programmatically via Newt, but I would not recommend it. There are several application-specific environments, e.g., for creating database forms. Newt's Cape(tm) 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). ----- 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" book (see "What other Newt-related packages are available?") 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: - demonstrations of each of the system prototypes (text objects, picture buttons, checkboxes, radio buttons, edit fields, gauges, lists, menus, expando shells, roll browsers, keyboards, floating views, ...) and behaviors (scroll, click, drag, file, route, assist, install, ...) - an application that modifies rolodex entries in your Name soup - add panels to the Formulas application - a number guessing game (Pico Fermi Bagels), including online help book - transfer data ("soups") to the desktop via serial connection (Slurpee) - calculators - soup browsers - object inspector - display bitmaps and play sounds -- built-in and in soups - the game of Life - Assist Calc (using Intelligent Assistant) - control your TV via infrared - questionnaires - extensions for the QuickFigure spreadsheet - for NOS 2.0: stationery, drag-and-drop applications, ... see examples.txt (with Newt) for the complete, current list ----- 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, most 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 reside entirely in heap when they are constructed, even with some creative use of soups, 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 using 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. Currently, the ExtractPackage utilities do not work with NOS 2.0 backups created by NBU (Newton Backup Utility). ----- How do I access Newt-created applications via the Extras drawer? Since Newt 3.0, 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 a concise 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., see Life 1.4 example for borrowing 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: - transfer source text between Mac or PC and Notepad - transfer bitmaps and sounds as tab-delimited text into resource soups - enter text and evaluate expressions with desktop keyboard - print selections, results and errors to desktop window (It's $10, or free to registered Newt users; see "What other Newt-related packages are available?") ----- 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; 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 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 do a lot of 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" -- see life.nwt example. ----- 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, high school and 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. I will be experimenting with distributing documentation and examples via the Web, Acrobat & Gopher (in addition to floppies). ----- Where can I find Newt? The current version is named newt-devenv-32.sit/.zip/.hqx [CIS: newt32.sit/.zip] and can be found on: - internet (also see mirror sites): - http://www.netaxs.com/~weyer/newton/releases.html - ftp://newton.uiowa.edu/submissions, or /pub/newton/software/.../app/ or /dev - ftp://sumex-aim.stanford.edu/info-mac/nwt - ftp://ftp.amug.org/pub/newton/newt-slurpee - newsgroups: comp.binaries.newton - America Online(AOL): PDA:Software Libraries:Newton (or PDA:New Files) - Compuserve(CIS): GO NEWTON (DL 8 or 9) - eWorld: Shareware:Newton - CD-ROMs: AMUG, Info-Mac,... ----- What other Newt-related files/packages are available? - Newt FAQ -- Frequently Asked Questions (available with Newt or in this separate text file) [newt-devenv-faq-32.sit/.hqx/.zip] [CIS: nwtfaq.sit/.zip] - NewtATut 1.3 (Newt Application Tutorial) -- a Newton book version of an article entitled "Building Native Newton Applications with Newt" that appeared in PDA Developers (formerly PIE Developers), Vol. 2.4, July 1994; pp.14-18. This interactive tutorial shows how you can develop a simple application in NewtonScript directly on your Newton using Newt. [newtatut-book-13.sit/.zip/.hqx] [CIS: apptut.sit/.zip]. NewtATut may also be available in Adobe's PDF (Portable Document Format) for use with Adobe's free Acrobat Reader for Macintosh, Windows, Unix, DOS [newtatut-pdf-12.sit/.zip/.hqx] [CIS: apptut.pdf]) - NewtTurt 1.3 (Newt Turtle Tutorial) -- a book showing you how you can use Newt for turtle-style graphics with the NewtDraw plug-in. [newtturt-book-13.sit/.zip/.hqx] [CIS: turtut.sit/.zip] NewtTurT may also be available in PDF format [newtturt-pdf-12.sit/.zip/.hqx] [CIS: turtut.pdf]) - Slurpee 1.7 -- a utility to transfer data or text between desktop files and Newton "soups" (databases); directs keyboard input to fields, and prints values and errors to desktop Inspector window; source available to registered Newt users. [slurpee-17.sit/.zip/.hqx] [CIS: slrp16.sit/.zip] - Life 1.4 -- "game of Life" cellular automatic/mathematical simulation; includes Newt source [life-14.sit/.zip/.hqx] [CIS: life14.sit/.zip] [look for life-13 with native RISC code: 4-40x faster] - Pico Fermi Bagels 1.3 -- number guessing game (similar to MasterMind); source & NewtPFB tutorial available to registered Newt users [pico-fermi-bagels-13.sit/.zip/.hqx] [CIS: pfb13.sit/.zip] (soon*: NewtPFB (Newt PFB Tutorial) -- a book like NewtATut showing how to create Pico Fermi Bagels. [newtpfb-book-11.sit/.zip/.hqx] [CIS: nwtpfb.sit/.zip] (NewtonBook) [newtpfb-pdf-11.sit/.zip/.hqx] [CIS: nwtpfb.pdf] (PDF)) *Note: this is available currently to registered users, but I will make it publicly available eventually... - Newt's Cape 1.1 -- create Newton books with text, graphics, links, tables and forms directly from HTML newtscape-11.sit/.hqx/nwscap11.zip [CIS: nwcp11.sit/.zip] - Acrobat Reader (2.1) -- an application for navigating, printing,... online documents is available free from: [Internet] ftp://ftp.adobe.com/pub/adobe/Applications/Acrobat/Macintosh, Windows, DOS, UNIX [America Online] Computing: Application or Electronic Publishing (Macintosh) PC Forums:Windows:Text & Word Programs (Windows) [Compuserve] GO ACROBAT or GO ADOBE, "Download Acrobat Viewer" (Macintosh, Windows, DOS) [eWorld] Library:MacWeek or Text&Pub (Macintosh) ----- Is there other Newt information available? In addition to this public FAQ, and information and examples contain in Newt-related packages just discussed, there is the article by me that parallels NewtATut: "Building Native Newton Applications with Newt" appeared in PDA Developers (formerly PIE Developers), Vol. 2.4, July 1994; pp.14-18. Erica Sadun reviewed Newt's turtle personality in the same issue. _protoReality 1.3 -- the NANUG newsletter, available as a Newton book -- features a year-old interview with me about Newt; _protoReality 2.2 has a "re-interview". _protoReality 1.3 & 1.4 have articles with my daughter on using Newt to draw letters. Serg Koren has written Newt reviews: http://www.netaxs.com/~archimag/revw.html You can check my web page which will evolve to contain the latest Newt info: http://www.netaxs.com/~weyer/newton/releases.html And, of course, you can register to receive much more info. ----- Why should I register? If you've thought about doing Newton development with NTK, and are unsure if you still want to spend $295 (BookMaker is an additional $195; reduced from original bundle price of $795), plus perhaps buy a Mac, 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), 190+ source examples (listed in examples.txt), 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 .hqx or .uu text 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 (using WebMaker to convert from FrameMaker), 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: - Mac or DOS format floppies - Acrobat files ok (or PostScript files) for docs - Acrobat Reader -- do you have it already (you can download Reader 2.1), or should I include a Mac or Windows version of Reader 2.0 *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? To register, you can - Save & print Newt's built-in registration form (tap the overview button, select About Newt, then tap Save (in Eval Controls) before exiting to create a registration form in Newt's current Notepad folder) -- and send a check* - or fill-in the form below -- and send a check* (cash possible though not encouraged -- ask me first) - use Compuserve's SWREG service** (Newt's ID#: 3143) [$49.50] - use a credit card by email registration via the Newton Register** application and Kagi shareware registration service (this typically requires NewtonMail, though may work with new Newton mail clients); there are also versions of Register for Macintosh and Windows -- check my home page, or contact me. If you can't find or use the Register application directly, you can send me your credit card info, and I can create an electronic registration form for you to submit. *registration fee via check = $45. **registration fee via Compuserve SWREG, Register, or foreign check = $49.50 (this includes several dollars more to cover some of the overhead charges and delays associated with SWREG and Kagi). If you're a high school student (or younger) or impoverished/starving university student, ask me about a special discount. There are no additional S&H or charges for international users. Currently registered users can upgrade to download files (or receive floppies) containing with latest releases, examples, and manual for $11 (SWREG #4567, Register) or $10 (check). A form is below. Also see register.txt for more details, especially about like Acrobat, Kagi, etc. Or contact me at weyer@netaxs.com If you tell me where you obtained Newt, e.g., uiowa, AMUG, sumex, AOL, Compuserve, eWorld, CD, friend, other, I can ensure that the latest versions appear there. ----- CUT HERE ----- Registration (newt-faq.txt): Newt 3.2 Date: ____________ To: Steve Weyer 17 Timber Knoll Drive Washington Crossing, PA 18977-1052 Internet: weyer@netaxs.com America Online/eWorld/NewtonMail: SteveWeyer Compuserve: 74603,2051 From: (optional) , /, , / and/or (optional) (highly recommended) Examples, Docs (choose A or B): #A. I'll download everything: _______ (tell me path & password) #B. Floppies: Mac (.sit) _______ (or) DOS (.zip) _______ Docs: Acrobat(PDF) _______ (or) PostScript _______ Include Acrobat Reader 2.0 _______ (I don't have 2.0 or 2.1) Where I obtained Newt: ______________ Check for $45 enclosed _____ (Upgrade: $10) Comments: ____________________________________________________________ ____________________________________________________________