Map
Index
Random
Help
Topics
th

Topic: primitive data types for Thesa

topics > computer science > programming > Group: Thesa programming system



Topic:
data types in Thesa
Topic:
primitive data types of a language
Topic:
Thesa data structures
Topic:
representation data type
Topic:
using pointers in Thesa

Summary

The problem here is what kind of information to store with object ids in abstract code; i.e., what kinds of distinctions needs to be made.

The declared type of an object is used for selection of functions, for type checking, and for data structure definition. The type along with a size declaration is used for storage allocation. The declared scope controls the allocation and deallocation of storage. (cbb 5/80)

We distinguish primitive values from memory. A primitive value is known by its type and size. The code generator determines the choices. They are currently integers, numbers, and reals, with bits anticipated. Type and size are known literally, though they could be variables. During code generation, the current location of a primitive value is tracked as it moves through registers, stack, label models, and procedure models.

When not tracked, a primitive value must be in memory. An object is in memory since its value must be somewhere at all times. The possible locations are global memory segment, stack, and literal storage. Global memory can be a disk cache. The code generator represents memory by a base, an offset, and a length. Base, offset, and length may be known literally, globally, or as a variable. The base determines the memory containing the object and the interpretation of the offset and length. The offset determines the location within memory, and length determines the size of the location.

Memory includes arrays and records as primitive concepts. An array uses variable offsets and fixed sized values while a record uses literal offsets and typed values.

Procedure arguments are passed by value-result for primitive values and passed by reference for memory. A reference consists of a base and offset. Recursive data structures are defined with references. Aliasing is the caller's error. Call-back procedures are also planned.

A constant is a text string that is converted by String, Real, or Number into a bit string. No units, no automatic conversion, no type-dependent conversion. A named constant has the same bit string value. (cbb 6/90, 10/93)

Subtopic: memory up

Topic: primitive data type as memory
Topic: variable as reference to storage
Topic: primitive data types of a language
Topic: universal data type
Quote: the only primitive form of Alphard corresponds to untyped, computer memory [»wulfWA6_1976]
Quote: computer memory is typeless; the same sequence of bits can be logical values, integers, code, etc. [»demeA_1978]
Quote: assume a typeless, universal value space; no inherent meaning to values, meaning only in reference to an operation [»donaJ7_1985]
Quote: universal value space is typeless and contains all data types and computable operations [»donaJ7_1985]

Subtopic: value up

Group: data value
Group: access to data
Quote: programming languages treat atomic data types as values and compound ones as objects; causes unnecessary confusion [»maclBJ12_1982]
Quote: computers must represent values as objects since abstractions are not physical [»maclBJ12_1982]
Quote: uniqueness of an object depends only on its external relations; exactly the opposite of a value [»maclBJ12_1982]
Quote: objects and variables retain their identity during change but values can never change [»maclBJ12_1982]
Quote: the state of an object is its internal properties and attributes at a given point in time [»maclBJ12_1982]
Quote: since an object's state changes with time, an object exists 'in time'; unlike a value [»maclBJ12_1982]
Quote: since objects exist in time, they can be created and destroyed [»maclBJ12_1982]

Subtopic: variables up

Group: variables
Group: parameters
Topic: parameter passing by value-result
Topic: temporary data objects
Topic: binding names to variables or expressions
Quote: in a type-complete language, any expression can be parameterized with respect to any free name
Quote: with type-completeness, any name that can be declared can also be a parameter [»demeA_1980]
Quote: a variable is an abstraction of an operand [»cbb_1973, OK]
Quote: a quantity is a name with a type and a value [»handP_1981]

Subtopic: data structure up

Topic: Thesa data structures
Topic: data record
Topic: database record
Topic: arrays
Topic: variables for array bounds
Topic: access to objects by a path
Quote: temporary integers are inexpensive but temporary structures are expensive; structures need update instead of value [»hoarCA_1973, OK]
Quote: Unix does not use the concept of a record; either as a fixed number of bytes and a count+bytes [»ritcDM7_1978b]
Quote: example of defining a structure by specifying the accessing algorithms; uses paraphrase extension [»wulfWA12_1971, OK]

Subtopic: pointers up

Topic: using pointers in Thesa
Topic: parameter passing by reference
Topic: shared objects
Topic: safe use of pointers
Quote: in CLU, a parameter is bound to the same object as the argument is bound to; changing the binding does not effect the argument [»liskBH2_1976, OK]
Quote: because of aliasing, changing one variable may accidentally change another [»hehnEC_1977a]
Quote: Mesa automatically handles p<-v and v<-p when v is a variable and p is a pointer [»gescCM6_1975, OK]
Quote: Cedar's safe pointers ensure integrity of system data structures and code [»swinDC7_1985]
Quote: Cedar reference variable contains address of collectible, single typed, data object; called a REF

Subtopic: data type -- At some level, a data object must be manipulated according to the data types provided by a computer. But the data types provided by the computer allow unlimited access to any data structure. What's needed is controlled translation between the two views. In Thesa, the definition of an operation is a translation of its title. But what is to prevent use of the definition directly? If there's something to prevent direct use, then how is it allowed within some operations but not within others? This looks like a judgment call which should be left to the users. Inappropriate use would eventually be caught and removed. Any proof of correctness would then depend on a cross-reference. A data type's set of operations can hide the use of the data type in other operations. (cbb 1/90) up

Quote: system programmers sees types as protection of bit strings from unintended interpretation [»wegnP10_1986]
Quote: implementers see types as a specification of storage mapping for values [»wegnP10_1986]
Quote: a 'hard' type is defined by the language with a representation, associated operations and values [»moffDV7_1981]
Quote: a partition type system allows one type for a value; used in most production programming systems such as C and FORTRAN
Quote: in C, types are specified by expressions; it works well for simpler cases [»ritcDM7_1978c]
Quote: in C, ornate types may be hard to interpret as a whole, but become understandable if read from inside out [»ritcDM7_1978c]

Subtopic: declaration up

Topic: declaration scope
Topic: global declarations and variables
Topic: local declaration of data
Topic: restricted use of global variables
Quote: a program includes global, local, and induction variables; only local and induction (the bound variables) may use shared storage; [»goldHH_1948, OK]

Subtopic: constants up

Topic: constants
Quote: with run-time translation of keys and offsets, would never use numbers except when desired [»lost entries, OK]
Quote: a literal is a constant variable whose value is suggested by its print name [»wulfWA4_1974]
Quote: a constant is type compatible if it can be a value of that type; it can be compatible with many types [»clayR4_1978]
Quote: the syntax of a literal defines a calculation that converts a print name into an internal value [»wulfWA4_1974]
Quote: Proteus included the format of literals as part of a type definition [»solnN_1971, OK]
Quote: any construct that requires a constant should also allow an expression of constants [»knobB4_1976]
Quote: a structured constant is defined with positional notation; error-prone [»veneT3_1978]

Subtopic: named constants up

Topic: named constants and expressions
Topic: enumerated data types
Topic: initialized constants
Quote: programmers used integer and character values as status values; indicated by comments [»goodJB2_1976]
Quote: use enumerated data type to define a new set of constants [»demeA3_1979]
QuoteRef: wirtN1_1971 ;;42 array [boolean (true or false)] of color [red orange yellow blue]
Quote: a named constant is defined exactly once; any expression involving name constants has a fixed value as long as they are defined [»redeDH7_1979]
Quote: by defining constants via a macro processor, C allows any string of characters to be substituted [»ritcDM7_1978c]
Quote: in C, defined constants are usually upper-case names to distinguish from variables [»ritcDM7_1978c]
Quote: a constant in Russell is any value-producing function of no arguments; must produce constant results [»demeA3_1979]
Quote: pass-by-constant makes a parameter the same as a constant; can't be destination of an assignment or passed-by-reference [»maclBJ_1987]
Quote: a constant is a permanent name for a value; a variable is a temporary name [»hehnEC7_1975]
Quote: Alphard allows initialized types; i.e., it is constant once defined [»wulfWA6_1976, OK]

Subtopic: call-backs up

Topic: procedure valued variables
Quote: while a C function is not a variable [i.e., no function arrays], a pointer to a function is a first-class value [»ritcDM7_1978c]
Quote: a call-back procedure is a procedure parameter in Cedar
Quote: a GP routine can take an executable argument by specifying its starting address; called plug-in coding [»randS_1957]
Quote: a registered procedure is a procedure-valued variable in Cedar
Quote: most abstractions in XDE were objects represented by a record with procedure variables to implement its operations
[»sweeRE7_1985]

Related Topics up

Topic: data types in Thesa (92 items)
Topic: primitive data types of a language (31 items)
Topic: Thesa data structures (59 items)
Topic: representation data type (21 items)
Topic: using pointers in Thesa
(49 items)

Updated barberCB 11/04
Copyright © 2002-2008 by C. Bradford Barber. All rights reserved.
Thesa is a trademark of C. Bradford Barber.