The Mouse Programming Language on CP/M
Step back to 1975 and explore Mouse, a tiny, stack-oriented programming language crafted for microcomputers like CP/M. Similar to Forth but even simpler, this retro gem packed high-level features into a mere 2KB. HN enthusiasts appreciate its minimalist design and historical significance in pushing computing boundaries with limited resources.
The Lowdown
The Mouse programming language, designed by Peter Grogono around 1975, is an interpreted, stack-oriented language built for microcomputers. Its core philosophy was to provide high-level language features with minimal resource requirements, an impressive feat for its time. Unlike Forth, Mouse relies more on explicit variables while still maintaining a compact, single-character instruction set.
- Design Philosophy: Mouse aimed to incorporate features like arrays, functions, procedures, nested control structures, local variables, recursion, and various parameter passing methods, all within a small footprint (the CP/M version is only 2KB).
- Syntax and Structure: Programs consist of a stream of mostly single-character instructions. Numbers are integers. Key instructions include arithmetic operations (+, -, *, /, ), input/output (?), variable manipulation (letter-based variables, : for store, . for fetch), and control flow ([ ] for conditionals, ( ) for loops, ^ to exit loops).
- Macros and Recursion: Mouse supports defining and calling macros (subroutines) using the
$and#characters, respectively. Parameters are handled via%, and macros can be recursive. - Variable Scoping: Variables are mapped to memory locations. Uppercase letters (A-Z) denote global variables, while lowercase letters (a-z) within macros represent local variables. Outside macros, lowercase letters behave as global variables.
- Availability: A version of Mouse for CP/M, updated by Lee R. Bradley, is available from the Walnut Creek CD archives and includes example programs.
Mouse stands as a testament to the ingenious ways developers crafted powerful tools with severe constraints, offering a fascinating glimpse into the early days of microcomputing where efficiency and conciseness were paramount.