Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Information Processing Language
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Basics of IPL== An IPL computer has: # A set of ''symbols''. All symbols are addresses, and name cells. Unlike symbols in later languages, symbols consist of a character followed by a number, and are written H1, A29, 9–7, 9–100. ## Cell names beginning with a letter are ''regional'', and are absolute addresses. ## Cell names beginning with "9-" are ''local'', and are meaningful within the context of a single list. One list's 9-1 is independent of another list's 9–1. ## Other symbols (e.g., pure numbers) are ''internal''. # A set of ''cells''. Lists are made from several cells including mutual references. Cells have several fields: ## P, a 3-bit field used for an operation code when the cell is used as an instruction, and unused when the cell is data. ## Q, a 3-valued field used for indirect reference when the cell is used as an instruction, and unused when the cell is data. ## SYMB, a symbol used as the value in the cell. # A set of ''primitive processes'', which would be termed ''primitive functions'' in modern languages. The data structure of IPL is the list, but lists are more intricate structures than in many languages. A list consists of a singly linked sequence of symbols, as might be expected—plus some ''description lists'', which are subsidiary singly linked lists interpreted as alternating attribute names and values. IPL provides primitives to access and mutate attribute value by name. The description lists are given local names (of the form 9–1). So, a list named L1 containing the symbols S4 and S5, and described by associating value V1 to attribute A1 and V2 to A2, would be stored as follows. 0 indicates the end of a list; the cell names 100, 101, etc. are automatically generated internal symbols whose values are irrelevant. These cells can be scattered throughout memory; only L1, which uses a regional name that must be globally known, needs to reside in a specific place. {|style="font-family:monospace; margin: 1em auto" class="wikitable" |+ IPL-V List Structure Example |- !Name !! SYMB !! LINK |- |L1 || 9-1 || 100 |- |100 || S4 || 101 |- |101 || S5 || 0 |- |9-1 || 0 || 200 |- |200 || A1 || 201 |- |201 || V1 || 202 |- |202 || A2 || 203 |- |203 || V2 || 0 |} IPL is an [[assembly language]] for manipulating lists. It has a few cells which are used as special-purpose registers. H1, for example, is the program counter. The SYMB field of H1 is the name of the current instruction. However, H1 is interpreted as a list; the LINK of H1 is, in modern terms, a pointer to the beginning of the call stack. For example, subroutine calls push the SYMB of H1 onto this stack. H2 is the free-list. Procedures which need to allocate memory grab cells off of H2; procedures which are finished with memory put it on H2. On entry to a function, the list of parameters is given in H0; on exit, the results should be returned in H0. Many procedures return a boolean result indicating success or failure, which is put in H5. Ten cells, W0-W9, are reserved for public working storage. Procedures are "morally bound" (to quote the CACM article) to save and restore the values of these cells. There are eight instructions, based on the values of P: subroutine call, push/pop S to H0; push/pop the symbol in S to the list attached to S; copy value to S; conditional branch. In these instructions, S is the target. S is either the value of the SYMB field if Q=0, the symbol in the cell named by SYMB if Q=1, or the symbol in the cell named by the symbol in the cell named by SYMB if Q=2. In all cases but conditional branch, the LINK field of the cell tells which instruction to execute next. IPL has a library of some 150 basic operations. These include such operations as: * Test symbols for equality * Find, set, or erase an attribute of a list * Locate the next symbol in a list; insert a symbol in a list; erase or copy an entire list * Arithmetic operations (on symbol names) * Manipulation of symbols; e.g., test if a symbol denotes an integer, or make a symbol local * I/O operations * "Generators", which correspond to iterators and filters in functional programming. For example, a generator may accept a list of numbers and produce the list of their squares. Generators could accept suitably designed functions—strictly, the addresses of code of suitably designed functions—as arguments.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)