{"title":"The software stack data-type as an operating system service","authors":"Jon W. Osterlund","doi":"10.1145/199200.316995","DOIUrl":null,"url":null,"abstract":"Codes which manage compilation and use of named software stacks are described. An item on such a stack ordinarily consists of one word, but it may be extended 'by a fixed length through association with an auxilliary field declared separately. In this way, structures such as buffers, inodes and I/0 redirection may be managed with the stacking discipline familiar to Forth users. Eight access methods are provided, which are bound to the desired stack within \"domains\" established by the user codes. Domains may be nested with one another, and with control structures such as BEGIN .. UNTIL, DO .. LOOP, and IF .. ELSE .. THEN. Examples illustrate co\"ect use. Preface The \"stack\" and \"R\" are familiar to Forth users. It is possible, however, to use Forth without awareness of the stack-like characteristics of the dictionary, into which codes may be loaded and from which they may be forgotten, and it is also possible to be aware of many of Forth's advantages without knowledge of \"reenterability\" or of \"list theory\". These topics are beyond the presegt scope, but the software stack data-type to be described is a contribution to the ease with which re-enterable codes may be written. Such codes are important because they allow the practj.ce of computing science to closely pfll\"allel the theory of lists, which in turn illumines the practice of Forth. One is tempted to write about successful applications of software stacks, rather than how or why they may be used. Often they provide a workable alternative to linked lists. But my uses, including management of RAM buffers, character-by-character buffering of keyboard input, the saving of environments (the old directory w.lten changing to a new one), multi-way sorts, and· a recursive disassembler, are less important than the effect they have had on the stackbuilder itself. It has become abstract in form and capable of early introduction to the system, thus providing its facilities throughout subsequent compilation. Software stacks can hold changing lists of lists (of lists .. ) containing references tQ compiled an~ executable Forth words. The overhead of ·interpretation is avoided, yet the lists remain subject to run-time modification. \"Stackbuilder\" refers to the code& shown and discussed in tfle appendix, which allow the user to declare stacks for private purposes, and to access them via eight \"methods\". Forth professionals familiar with compile-time nesting, state-sensitive behavior, saving of data on E,, and the <BUILQS .. DOES> construct can look \"under the hood\", but it is my purpose to introduce the use of those codes, not their operation. Perhaps you will discover. additional applications of this versatile data-type. Introduction •• A Simple Example A Forth user may declare a software stack named MYST ACK which will hold up to 10 items, by writing:","PeriodicalId":441527,"journal":{"name":"Annual Workshop on Forth","volume":"53 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1993-12-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Annual Workshop on Forth","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/199200.316995","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
Codes which manage compilation and use of named software stacks are described. An item on such a stack ordinarily consists of one word, but it may be extended 'by a fixed length through association with an auxilliary field declared separately. In this way, structures such as buffers, inodes and I/0 redirection may be managed with the stacking discipline familiar to Forth users. Eight access methods are provided, which are bound to the desired stack within "domains" established by the user codes. Domains may be nested with one another, and with control structures such as BEGIN .. UNTIL, DO .. LOOP, and IF .. ELSE .. THEN. Examples illustrate co"ect use. Preface The "stack" and "R" are familiar to Forth users. It is possible, however, to use Forth without awareness of the stack-like characteristics of the dictionary, into which codes may be loaded and from which they may be forgotten, and it is also possible to be aware of many of Forth's advantages without knowledge of "reenterability" or of "list theory". These topics are beyond the presegt scope, but the software stack data-type to be described is a contribution to the ease with which re-enterable codes may be written. Such codes are important because they allow the practj.ce of computing science to closely pfll"allel the theory of lists, which in turn illumines the practice of Forth. One is tempted to write about successful applications of software stacks, rather than how or why they may be used. Often they provide a workable alternative to linked lists. But my uses, including management of RAM buffers, character-by-character buffering of keyboard input, the saving of environments (the old directory w.lten changing to a new one), multi-way sorts, and· a recursive disassembler, are less important than the effect they have had on the stackbuilder itself. It has become abstract in form and capable of early introduction to the system, thus providing its facilities throughout subsequent compilation. Software stacks can hold changing lists of lists (of lists .. ) containing references tQ compiled an~ executable Forth words. The overhead of ·interpretation is avoided, yet the lists remain subject to run-time modification. "Stackbuilder" refers to the code& shown and discussed in tfle appendix, which allow the user to declare stacks for private purposes, and to access them via eight "methods". Forth professionals familiar with compile-time nesting, state-sensitive behavior, saving of data on E,, and the construct can look "under the hood", but it is my purpose to introduce the use of those codes, not their operation. Perhaps you will discover. additional applications of this versatile data-type. Introduction •• A Simple Example A Forth user may declare a software stack named MYST ACK which will hold up to 10 items, by writing: