Mouse (programming language): Difference between revisions

Content deleted Content added
link to FALSE
Bender the Bot (talk | contribs)
m External links: HTTP to HTTPS for SourceForge
 
(36 intermediate revisions by 28 users not shown)
Line 1:
{{Short description|Programming language}}
[[Image:mouse-book-cover.png|right|thumb|140px|Book cover]]
The '''Mouse''' programming(sometimes written as language'''MOUSE''') programming language is a small computer [[programming language]] developed by Dr. Peter Grogono in the late 1970s and early 1980s.<ref name="grogono1">Grogono,{{cite Peternews | url=https://archive.org/stream/byte-magazine-1979-07/1979_07_BYTE_04-07_Automating_Eclipses#page mii/n197/mode/2up "| title=Mouse: / A Language for Microcomputers", ''Byte'',| work=BYTE | date=July 1979 | accessdate=18 October 2013 | author=Grogono, pp.Peter 198ff| pages=198–220}}</ref><ref name="byte198006">{{cite news | url=https://archive.org/stream/byte-magazine-1980-06/1980_06_BYTE_05-06_Inter_Computer_Communications#page/n243/mode/2up | title=Comment and Correction for Mouse | work=BYTE | date=June 1980 | accessdate=18 October 2013 |author1=Lane, Tom |author2=Grogono, Peter }}</ref><ref name="grogono2">Grogono, Peter. ''Mouse: A Language for Microcomputers''. 151 pages. Petrocelli Books, Inc.: 1983. {{ISBN |0-89433-201-5}}.</ref> It was developed as an extension of an earlier language called MUSYS, which was used to control digital and analog devices in an electronic music studio.
 
Mouse was originally intended as a small, efficient language for [[microcomputer|microcomputers]]s with limited memory. It is an interpreted, [[Stack-oriented (data structure)programming|stack-based]]-based language and uses [[Reverse Polish notation]]. In order toTo make an interpreter as easy as possible to implement, Mouse is designed so that a program is processed as a stream of characters, interpreted one character at a time.
The '''Mouse programming language''' is a small computer programming language developed by Dr. Peter Grogono in the late 1970s and early 1980s.<ref name="grogono1">Grogono, Peter. "Mouse: A Language for Microcomputers", ''Byte'', July 1979, pp. 198ff.</ref><ref name="grogono2">Grogono, Peter. ''Mouse: A Language for Microcomputers''. 151 pages. Petrocelli Books, Inc.: 1983. ISBN 0-89433-201-5.</ref> It was developed as an extension of an earlier language called MUSYS, which was used to control digital and analog devices in an electronic music studio.
 
Mouse was originally intended as a small, efficient language for [[microcomputer|microcomputers]] with limited memory. It is an interpreted, [[Stack (data structure)|stack]]-based language and uses [[Reverse Polish notation]]. In order to make an interpreter as easy as possible to implement, Mouse is designed so that a program is processed as a stream of characters, interpreted one character at a time.
 
The elements of the Mouse language consist of a set of (mostly) one-character symbols, each of which performs a specific function (see table below). Since variable names are limited to one character, there are only 26 possible variables in Mouse (named A-Z). Integers and characters are the only available data types.
 
Despite these limitationslimits, Mouse includes a number of relatively advanced features, including:
 
* Conditional branching
Line 16 ⟶ 15:
* Code tracing
 
The design of the Mouse language makes it ideal for teaching the design of a simple interpreter. Much of the book describing Mouse<ref name="grogono2" /> is devoted to describing the implementation of two interpreters, one in [[Z80]] [[Assembly_language|assembly language]], the other in [[PASCALPascal (programming language)|Pascal]].
 
==Detailed DescriptionDetails ==
The language described here is the later version of Mouse, as described in the Mouse book.<ref name="grogono2" />. This version is an extension of the language described in the original magazine article.<ref name="grogono1" />.
 
===Mouse Symbols ===
The language described here is the later version of Mouse, as described in the Mouse book<ref name="grogono2" />. This version is an extension of the language described in the original magazine article<ref name="grogono1" />.
The following table describes each of the symbols used by Mouse.<ref name="grogono2" />. Here X refers to the number on the top of the stack, and Y is the next number on the stack.
 
{| class="wikitable"
===Mouse Symbols===
! Symbol
 
! Action
The following table describes each of the symbols used by Mouse<ref name="grogono2" />. Here X refers to the number on the top of the stack, and Y is the next number on the stack.
 
{| class="wikitable"
|-
! title="Symbol" | Symbol
! title="Action" | Action
|-
|align="center"| <space>
| No action
|-
Line 131 ⟶ 127:
|}
 
===Language Expressions ===
 
====Common Idioms====
 
==== Common Idiomsidioms ====
These expressions appear frequently in Mouse programs.
 
Line 140 ⟶ 135:
X: ~ store into variable X
X. ~ recall variable X
X. Y: ~ assigncopy X tointo Y
N. 1 + N: ~ increment N by 1
P. Q. P: Q: ~ swap values of P and Q
Line 148 ⟶ 143:
 
====Input====
 
Mouse may input integers or characters. When a character is input, it is automatically converted to its ASCII code.
<pre>
Line 166 ⟶ 160:
 
====Conditionals====
 
A conditional statement has the general form:
<pre>
Line 174 ⟶ 167:
 
====Loops====
 
Loops may have one of several forms. Most common are the forms:
<pre>
Line 182 ⟶ 174:
Here again ''B'' is a boolean value (0 or 1), and ''S'' is a sequence of statements.
 
====Macro Callscalls====
 
The format of a macro (subroutine) call may be illustrated by the following example. Macro A in this example adds the two parameters passed to it from the main program, and returns the sum on the top of the stack.
Line 192 ⟶ 184:
Here ''p1'' and ''p2'' are parameters passed to the macro.
 
=== Example Programsprograms ===
 
This short program prints 'Hello world.'
<pre>
Line 207 ⟶ 198:
 
==Notes==
{{Reflist|2}}
<div class="references-small" style="-moz-column-count:2; column-count:2;">
<references/>
</div>
 
==See also==
* [[FALSE]] esoteric programming language
 
==External links==
* [http://users.encs.concordia.ca/~grogono/Mouse/mouse.html The Mouse Programming Language]
* [https://web.archive.org/web/20070307145837/http://www.geocities.com/fullerhaparnoldafmil/mouse.html The Great MOUSE Programming Language Revival]
* [https://archive.today/20030506120304/http://cth.dtdns.net/mouse/ Friends of the Mouse]
* [http://primepuzzle.com/mouse/mouse.html Mouse, the Language]
* [http://mouse.davidgsimpson.com Mouse: Computer Programming Language] (includes source code for Mouse interpreters)
* [httphttps://mouse.sourceforge.net/ Information on sourceforge.net]
 
{{Authority control}}
 
[[Category:Programming languages]]
[[Category:Stack-oriented programming languages]]