NewtonScript

NewtonScript is an object-oriented programming language developed by Walter Smith for Apple for the Newton OS running on their MessagePad & eMate hardware. It borrows concepts from the Smalltalk, LISP, and Self programming languages with special consideration for a low memory footprint (esp. differential inheritance). In 2003 a NewtonScript interpreter, NEWT/0 was developed by Makoto Nukui allowing for its use on other platforms.

For assistance with programming in the NewtonScript language beyond the documentation provided here, it is suggested that you join the newtonscript-lang.slack.com Slack team (get an invite), join the #newtonscript channel on irc.libera.chat, tag a question with the 'newtonscript' tag on stackoverflow.com, or post to the NewtonTalk mailing list.

Table of Contents

Development Tools
Documentation
Libraries
Sample Code
Further Reading

Development Tools

Dashboard

An alternate button bar, hierarchical menu, and scripting system (using NewtonScript) for Newton OS. Source available on GitHub.

DyneTK

A cross-platform IDE for Newton OS software development. Built on NEWT/0.

Einstein

A Newton OS 2.1 emulator. It includes a “Relativity” feature that allows NewtonScript to call native methods from the parent OS from within the Newton OS.

Minspector

A Newton OS Newton debugging tool modeled after the Newton Toolkit Inspector.

NEWT/0

A multi-platform NewtonScript interpreter. Matthias Melcher has also created a modified version of NEWT/0 that compiles on 64-bit architectures.

newt.vim

A cross-platform Vim syntax highlighter for the NewtonScript language.

NewtDevEnv (Newt)

An environment for developing applications using NewtonScript and creating packages natively on a Newton OS device.

Newton Data Browser

A application which can send NewtonScript commands and functions to a Newton device and then retrieve the results using a desktop or laptop computer.

NewtonScript Xcode Language Specification

An Xcode language specicification (syntax highlighter) for the NewtonScript language.

NewtonScript Mode

A SubEthaEdit and Coda Mode (syntax highlighter) for the NewtonScript language.

NewtonScript Codeless Language Module

A BBEdit and TextWrangler Codeless Language Module (syntax highlighter) for the NewtonScript language.

Newton Inspector

A native implementation of the NTK Inspector window for Mac OS X.

Newton Personal Data Sharing (NPDS)

A web server for Newton OS which can be scripted to generate dynamic content using NewtonScript.

Newton Toolkit (NTK)

Apple’s original IDE for Newton OS software development.

Newton Toolkit for Mac OS X (NTX)

A modern replacement for Apple’s original Newton Toolkit.

Newton Toolkit Bracket Highlighting & Balancing

This bit of code adds visual bracket matching, highlighting, and balancing functionality to the Newton Toolkit editor.

NSM

A portable NewtonScript bytecode virtual machine.

Prota

An implementation of NewtonScript written in C++.

ROM Soup

A utility for exploring the Soup contained within Newton ROM images. It can preview code, strings, pictures, sounds, and more.

tntk

A command line NewtonScript compiler and packager. Built on NEWT/0.

ViewFrame

A live NewtonScript object browser, editor, and debugging tool.

Libraries

MacInTalk

Apple's official MacInTalk Text-to-Speech extension for Newton OS.

mbed TLS

A port of the mbed TLS SSL/TLS library to NewtonOS, allowing for secure network communications.

Newton Messaging Enabler

Apple's Messaging Enabler "Provide[s] high-level support for a wide variety of messaging devices. Messaging devices are both one-way and two-way pagers, or more generally, any device that can receive (and maybe send) short, usually less than 5 KB, wireless messages."

NHttpLib

An HTTP library for Newton OS. Source available on SourceForge.

NSUnit

A simple xUnit unit testing framework for the NewtonScript language (currently supporting NEWT/0) by Morgan Aldridge.

ntox

A port of the tox XML/HTML tokenizer.

ZLib

A partial port of the zlib compression library, based on the version 1.1.4 release.

Documentation

Class-based NewtonScript Programming

A paper explaining conventions for simulating class-based programming in NewtonScript, which is a prototype-based language, from the designer of the language.

Developing NewtonScript apps for the Apple MessagePad

A walk-through on setting up a Newton Toolkit development environment using Basilisk II and Einstein emulators.

develop

Apple’s quarterly technical journal published from 1990-1997, before being pulled into MacTech magazine as a regular column. The following issues contain Newton/NewtonScript-specific articles:

Dr. Dobb’s

Michael Swaine explored the Newton as a platform, NewtonScript as a programming language, and NTK as a development environment in 1994 & 1995 for his “Programming Paradigms” column in Dr. Dobb’s magazine.

Note: Free registration required to view more than two articles.

Folklore.org: The Newton, The First PDA

“Anecdotes about the development of the Newton, the world's first PDA.” The following articles cover NewtonScript:

Frames in GoLisp

An explanation of the frames implementation in GoLisp, including comparison to Self & NewtonScript, by which it was inspired.

Hammering Newton

Unofficial documentation of the inner workings of Newton OS as gleaned using the "Hammer" low level debugger. The following sections are NewtonScript-specific:

How to Work with the Text-to-Speech Extension

An example of developing with the MacInTalk Text-to-Speech extension.

More Newton Text to Speech

An explanation of the embedded commands available in the MacInTalk Text-to-Speech extension.

Newton 2.x OS Q&As

Additional clarification, documentation, and examples for Newton OS 2.x development, including a section devoted to NewtonScript (though much of the rest of the documentation is relevant to developing in NewtonScript anyway). Available as a single page containing all content or multiple pages by section.

The Newton Application Architecture

Official overview of the Newton application architecture, including the NewtonScript language, view system, object store, and communications system.

Newton Book Maker User’s Guide

Official documentation on creating digital books and application help for the Newton, including the use of NewtonScript to customize book interaction, display, and behavior.

Newton Bowels

Unofficial documentation of the inner workings of Newton OS. The following articles are NewtonScript-specific:

Newton Formats

Official documentation of Newton data formats and protocols.

Newton Formats Errata

Unofficial corrections to errors found in Apple's Newton Formats documentation.

Newton OS 2.1 Engineering Documents

Official documentation of changes and additions in Newton OS 2.1, including: NewtWorks, keyboard enhancements, grayscale imaging, graphics shapes, sound, dial-in networks, IrDA communications tool, and the eMate 300 multi-user environment.

Newton OS 2.1 Engineering Documents: Miscellaneous

A preliminary draft version of Chapter 11: Miscellaneous that appears to have been intended to be added to the Newton OS 2.1 Engineering Documents, covering additions in Newton OS 2.1 that weren't, "[L]engthy enough to warrant their own chapters."

Newton OS Error Database

A searchable database of Newton OS error codes gleaned from the NTK for Windows v1.6.1 help file, NIE 2.0 API documentation, and Lantern DDK documentation.

Newton Programmer’s Guide (for Newton 2.0)

Official documentation for the Newton OS 2.0 application programming interfaces, providing an overview and conceptual information. See the Newton Programmer’s Reference for detailed reference documentation of data structures, functions, constants, and error codes.

Newton Programmer’s Guide: 2.1 OS Addendum

Official documentation covering additions and changes in the Newton OS 2.1 application programming interfaces.

Newton Programmer’s Reference (for Newton 2.0)

Official documentation of the Newton OS 2.0 protos, methods, functions, data structures, and error codes. A companion to the Newton Programmer’s Guide.

NewtonScript ByteCode

Documentation of the NewtonScript bytecode as compiled through observation.

NewtonScriptに見る: もうひとつのプロトタイプ指向

An overview of the NewtonScript language presented at the 2008 Lightweight Language conference in Toyko, Japan.

The NewtonScript Programming Language

Official introduction & reference material for the NewtonScript language under Newton OS 2.x. You’ll probably want to start here.

プログラミング言語 NewtonScript

An unofficial Japanese translation of Apple’s NewtonScript Programming Language reference.

Newton Technology Journal

Apple’s Newton-specific technical journal, published six times per year from 1995-1997. The content is 70% development and 30% marketing.

Newton Toolkit 1.6.x File Formats

Official documentation of file formats used by NTK 1.6.x for Windows and Macintosh, specifically Project files, Layout files, and native code module files.

Newton Toolkit Tips and Tricks

Tips & tricks for NTK, esp. the Windows version.

Newton User Interface Guidelines (for Newton 2.0)

Official documentation of Newton OS 2.0 user interface and how to optimize software for it, including the whys and hows.

Newt’s Cape: NewtonScript Syntax

This document covers issues related to embedding NewtonScript syntax in HTML and embedding HTML in NewtonScript.

Programming for the Newton: Software Development with NewtonScript

Programming for the Newton Using Macintosh

Programming for the Newton Using Windows

SELF and the Origins of NewtonScript

An introduction to the paper Self: The Power of Simplicity, by Ungar and Smith, which describes the aspects of NewtonScript which were inspired by the SELF programming language.

Soups on the Newton

An overview on creating and interacting with soups using NewtonScript.

The NewtonScript Programming Language

An overview of NewtonScript language, illustrating the differences between object oriented programming paradigms and relating how some NewtonScript features have their own particular programatic flavor.

User Interface Guidelines for Newton OS 2.1 Keyboard Enhancements

A supplement to Newton User Interface Guidelines which specifically covers the keyboard enhancements in Newton OS 2.1.

Using a Prototype-based Language for User Interface: The Newton Project’s Experience

An explanation of how the Newton OS user interface was implemented using a prototype-based language (NewtonScript) and the advantages it has over class-based languages.

Writing Assembly for Your Newton

Primarily discusses writing, linking, and packaging assembly code for Newton OS, but also covers communicating between assembly code and NewtonScript code.

Sample Code

Internal Serial Enabler

Sample NTK & MPW project for Newton OS 2.1 to control the internal serial port, incl. toggling channels and GPIO.

Newton 2.x OS Sample Code

Official sample Mac OS & Windows NTK projects for Newton OS 2.x.

Further Reading

Talking with Mikel Evins about the Lisp-based Newton OS

In 2004, Rainer Joswig spoke with Mikel Evins, a former member of Apple’s Newton group, about an early development version of Newton OS written in Lisp.

Dad Hacker

Reminiscing about early Newton development, programming, and NewtonScript with Landon Dyer, a member of the original Newton team.

Also available as audio files from Mac Folklore Radio.