- Environments
- Documentation
- Sample Code
- Source Code
A. Environments
1. What are Apple’s tools to develop software for the Newton?
a. Newton Toolkit
Newton Toolkit (NTK) allows you to develop programs in NewtonScript on Mac OS or Windows, installing them as packages onto a Newton device. There is also a cross-platform debugger for NewtonScript programs.
Installers and documentation for Newton Toolkit are available from Planet Newton’s Newton Programming Tools.
Newton Toolkit is also included as part of NewtonDev, an archive of essential development tools and documentation for classic Mac OS. NewtonDev also includes a bootable image for use with the Basilisk II emulator.
Be aware, that Newton Toolkit might not work in Classic under Mac OS X if it cannot find a serial port. To fix this problem, you might need to create or define a serial port using software.
To create a virtual serial port, you can try Stalker Software’s PortShare.
- Install “PortShare Demo”.
- Boot into Classic.
- Open the “PortShare Demo” control panel and create a new port.
- Start Newton Toolkit and select the port you created.
You can also use TCPSerial to simulate a serial port using a TCP/IP connection.
b. Newton C++ Toolbox
The Newton C++ Toolbox (NCT) is divided into several parts available at various places on the internet:
Installers and documentation for Newton Toolkit are available from Planet Newton’s Newton C++ Tools.
Additional Driver Development Kits (DDKs) are available from UNNA.
There is also the Lantern DDK for developing ethernet card drivers. It includes the Hammer and Newtsbug low level debuggers.
Newton C++ Toolbox requires the Macintosh Programmer’s Workshop (MPW), which is available from Macintosh Garden and as part of NewtonDev.
NewtonDev includes documentation, additional support files, and bug fixes for Newton C++ Toolbox.
2. What tools let me develop directly on the Newton?
a. Newton Dev Environment
Steve Weyer’s Newton Dev Environment (NDE) allows you to build packages directly on the Newton.
Here’s a comparison of Newton Toolkit and Newton Dev Environment provided by Paul Guyot.
- NDE:
- Pros:
- develop directly on your Newt
- save applications as packages
- play with the turtle
- easier to incorporate Help Books (typically created with Newt’s Cape)
- continued support from Steve
- Cons:
- no graphical interface to develop your pro GUI, but Serg Koren’s VisualNewt provides a graphical layout editor.
- direct text input for frames
- no way to compile C++ code on your Newton (but you can import libraries)
- no way to compile “native” NewtonScript (but you can import such)
- no debugger (but you can use ViewFrame)
- Purpose: all software that does not require resources (you must import them) and too complex GUI. But you can also use Newt’s Cape to write form-based applications.
- Pros:
- NTK:
- Pros:
- graphical interface (like RAD) allow C++ code with NCT.
- allow native functions.
- debugger (with breakpoints and steps) is available (for NewtonScript code only)
- Cons:
- cross development (i.e. develop on your Mac or your Windows device)
- discontinued software
- can be exported from Mac OS to Windows only
- Purpose: all software, including these that require big resources and complex GUI.
- Pros:
b. nsScribe
Prism Research’s nsScribe allows you to execute NewtonScript code from the Notepad, the Assistant or Newton Works.
c. ViewFrame
Jason Harper’s ViewFrame is a very powerful tool for debugging directly on the Newton, inspect the Newton environment. However, it does not allow you to set breakpoints or to step.
3. Are there other programming languages for the Newton?
a. NS Basic
NS Basic is a complete implementation of the BASIC programming language, with extensions to take advantage of Newton OS.
Once a commercial application, George Henne has released NS Basic and its source code on GitHub.
b. NewtCard
NewtCard is a HyperCard-like environment for the Newton. It allows you to manage text and pictures as a collection of cards. Easily add text fields, check boxes, buttons, and other elements to the cards. Buttons can be scripted using NS Basic.
Once a commercial application, George Henne has released NewtCard and its source code on GitHub.
Archived NewtCard Demo files are also available.
c. Lisp
LittleLisp is a Lisp interpreter for the Newton developed by David Benn.
d. Assembler
Roger Milne succeeded in writing programs such as ModPlayer in assembly language on his PC with a GNU assembler. His process is documented in the article Writing Assembly for your Newton.
There is also the Compiler-Formerly-Known-As-ChARM (CFKAC) by Prism Research. It allows to compile and disassemble code directly on the Newton using nsScribe.
e. Java
Sean Luke, Steve Weyer, and several other contributors implemented a subset of Java called Waba on the Newton platform. The software is currently in beta release, with binaries and source code available on Sean’s Waba for the Newton page.
f. C/C++ on other platforms
C++ and other compiled languages can basically be used in two ways: as native functions and for P-Classes which are used in drivers. The Newton C++ Toolbox is more than a compiler and a linker. It also includes tools to use this C++ code, either to convert a link output to a Native Module, a file used by NTK or to generate and pack a P-Class.
All the documentation required to make a tool to convert from link output to NTK is available, but no such tool exists. Therefore, with a C/C++ suite, you will have to use NCT anyway. The other solution is to use Roger Milne’s MakePKG tool.
The format of the P-Class encapsulated programs is unknown.
Finally, the low level debuggers (Newtsbug and Hammer) only run on Mac OS. Apparently, they are based on RDI, but nobody succeeded to write a compatible low level debugger.
There are several C/C++ compilers for ARM, here are just the most common ones:
- The ARM SDT from arm: http://www.arm.com/
- GNU C/C++ compiler for Intel based computers (apparently, the Sparc tools archive is corrupted) ftp://ftp.intel.com/pub/i960/XScale/SA1tools/
You can also use Newton C++ Toolkit with Basilisk II.
Basilisk II is a 68k Mac OS emulator that runs on several platforms, including Mac OS X, Windows, BeOS, various flavours of UNIX with X11, and AmigaOS.
4. Are there any other tools to develop Newton packages?
Pinehill Softworks’ AppGen lets you create simple data collection applications on your Newton and export the data to a PC using PineHill Mover.
B. Documentation
1. Where can I find documentation?
a. Apple Programming Reference
Apple published Find Info, a PDF listing information about where to locate Newton development documentation.
Although the Newton Programmer’s Guide (NPG) is the first source, it is not necessarily the most complete or up to date. There are a number of additional places you can search for information on the Newton Platform APIs.
Below is a simplified version of that document with links added.
- Newton Programmer’s Guide 2.0 & Newton Programmer’s Reference 2.0
This is the primary source of information. Start here when searching. All the other sources of documentation supplement this guide.- Programmer’s Guide:
- Programmer’s Reference:
- Newton Programmer’s Guide 2.1
This is a supplement to the Newton Programmer’s Guide and Newton Programmer’s Reference. It is the main source for the new APIs in Newton OS 2.1. Like NPG, this is a primary source of information. - NewtonScript Reference
This is the primary reference for the NewtonScript language and related support functions.- NewtonScript Programming Language:
- Newton 2.x OS Q & As (Q_AND_AS)
New and updated information on APIs and extra explanation. This is one of the best sources of information apart from the Newton Programmer’s Guide. They can be found on UNNA: http://www.unna.org/view.php?/apple/documentation/developer/QAs-2.x - Platform File Functions (PLATFUNC)
This contains documentation on APIs that are included as part of the Platform File. The APIs are either new APIs or replacements for ones already in the ROM. - Sample Code (SAMPCODE)
In addition to showing you how to use particular features, some pieces of sample code contain interim documentation. - NTK 1.6 User’s Guide (WINNTK16.PDF)
In addition to documenting Newton Toolkit, this guide also contains valuable information on both debugging your application and performance tuning.
b. Other Apple Documents
Apple published additional books. These can be found on Newton Gurus’ sites.
- Newton Formats (1.1) describes the format of packages and stream objects.
It can be found on UNNA: http://www.unna.org/unna/apple/documentation/developer/NewtonFormats1.1.pdf - Newton Toolkit 1.6.x File Formats describes the format of NTK files for both Mac OS and Windows.
It can also be found on Roger Milne site: http://www.geocities.com/SiliconValley/Code/5100/newton/ntkfrmat.pdf - Newton Interconnect Port Hardware Specification for the MessagePad.
It can be found on UNNA http://www.unna.org/view.php?/development/documentation/interconnect - Newton OS 2.1 Engineering Documents
- Newton Toolkit Enhancements
- Newton OS 2.1 Miscellaneous
- Newton 2.0 User Interface Guidelines
- User Interface Guidelines for Newton OS 2.1 Keyboard Enhancements
c. Other Articles & Documentation
There were a lot of articles written by Apple and third-party developers. They were published in the Newton Technology Journal, in the PIE Developers and other journals.
- The Newton Technology Journal contains both general and developer information. Issues from February 1995 (Volume I, Issue 1) to March 1997 (Volume III, Issue 2) were published.
- Specific articles by the Newton ToolBox Group.
- You can also look into develop issues, on Apple’s website: http://developer.apple.com/dev/techsupport/develop/
- You can also look into Handheld Systems Magazine. Some articles were published there. The issues used to be found on UNNA, they might be back in some time. They used to be on cdpubs website, but they finally decided to charge for it. Note that all these articles can be found elsewhere. Some were archived by web.archive.org: http://web.archive.org/web/*re_pd_/http://cdpubs.com*
- There are Ask The Llama articles in the form of developer Q & A.
- If you’re interested in articles explaining how the Newton OS or the NewtonScript language works, you can go to Walter Smith’s website http://wsmith.best.vwh.net/works.html Walter Smith is the father of NewtonScript and is responsible for other great parts of the Newton OS.
- Finally, there are all the programming hints from the Newton developer website.
You can also consult the documentation concerning the processor (ARMs). Please note that this is useless to the NewtonScript developer. It is only useful for assembly development and sometimes C++ development.
- The ARM Architecture Reference Manual by D. Jaggar. You can order the paper version from any good (internet) library. You can get the electronic version by ordering a free evaluation copy of the ARM Development Suite at http://www.arm.com/sitearchitek/devtools.ns4/html/ads_eval?OpenDocument You’ll find in this book a (simple) diagram of the Runt based MessagePad devices. There are other reference manuals for the ARM such as the ARM System-on-Chip Architecture by S. Furber and The ARM RISC Chip, A Programmer’s Guide by A. van Someron & C. Atack.
- The ARM SDT Reference Manual. This manual isn’t a manual to the processor but a manual to the ARM SDT which the Newton C++ Toolbox is a MPW port of. The SDT changed a lot, but it’s there that you’ll find information about the compiler’s behavior (e.g. data size).
- You can find additional documentation on ARM’s website. They are not very interesting for Newton development, though, except the Quick reference guide. http://www.arm.com/Documentation/
- Intel has several application notes and technical documents about the StrongARM, including one on the memory management (one of the sources about the ARM MMU). They can be downloaded from the Intel’s developer website: http://developer.intel.com/design/strong/
d. The Newton Bowels Project
The inner workings of Newton OS are not well documented. However, several developers were able to discover certain useful details while digging around the system in their attempts to interface with it. The Newton Bowels Project is a repository of documents, sample code, and other “thrill-seeking” tools.
e. NewtonScript.org
A one-stop shop for all things related to the NewtonScript programming language. NewtonScript.org is a collaborative project hosted on GitHub, collecting all manner of NewtonScript development tools, documentation, libraries, sample code, and other resources.
2. Where’s a good place to start?
Our advice is to start with the code examples that come with Steve Weyer’s Newton Dev Environment or Apple’s Development Examples.
You can also try Steve Weyer’s interactive NewtATut (Newt Application Tutorial) that shows how to develop a simple application in NewtonScript directly on your Newton device.
C. Sample Code
1. Where can I find sample code?
Most of the sample code and developer examples distributed by Apple are available from UNNA as part of the Development Examples and NewtonDev collections.
You can also find sample and source code as part of NewtonScript.org and The Newton Bowels Project.
See also: Where can I find source code?
2. Where can I find a list of Apple’s sample code?
A complete list of Newton 2.x OS Sample Code with descriptions was published on the Newton Inc. website in 1997.
Unfortunately, this copy of the information located in the Internet Archive does not have valid links to the source code itself.
D. Source Code
1. Where can I find source code?
Eckhart Köppen includes the source code for every version of every package he’s created.
Adam Tow includes source code for most of his Newton software.
Steve Weyer published source code for much of his popular Newton software, including Newt’s Cape, NewtVNC, Sloup, Waba, Crypto, and NewtDevEnv.
George Henne published the source code for his NS Basic and NewtCard development tools.
Mason Mark published the source code for his incredibly powerful Dash Board enhancement.
Simon Bell supplies source code for his Mail V and SimpleMail email clients, as well as his Sudoku game.
See also: Where can I find sample code?