From Chessprogramming wiki
Jump to: navigation, search

Home * Programming * Data

Data is anything in a form suitable for use with a computer to represent information or knowledge. Bits, bytes, characters, strings, numbers, codes, sets, sequences and structures, as well as references (pointers, addresses) to related data, retrievable stored in memory of any kind of hardware.

A variable in the context of programming languages, associates a symbolic name with a memory address.

Processor's View

From processor's point of view, an atomic fixed sized data item with a unique memory address is a primitive data item, today usually with a size of one, two, four, or up to eight bytes, sometimes even 16 or 32 bytes. One of these data items may represent numbers in various formats and value ranges, finite sets, codes like a character of a text or a piece on the chessboard, or even instruction codes and memory addresses. It fits into one processor register and is subject of arithmetical or logical operations, or, if interpreted as (part of an) address, to perform random memory access, that is to store and retrieve primitive data items. Program code is decoded and interpreted as instruction to control the combinatorial and sequential logic while executing a program within its processor, usually distinct from application specific data, if the application is not an assembler, compiler or debugger or anything related to self-modifying code or self-replication [2] .

A collection of primitive data types, located consecutively in memory may be accessed relative to the address of its first element via another data item, an index, or - specially if the primitive data items have different sizes, via constant offsets. From machine perspective, this covers array (vector) and structure, while the latter may be interpreted as concrete implementation of abstract objects.

Lifetime of Data

Data may resist in persistent non-volatile memory or volatile random-access memory. The lifetime of volatile data depends on the data declaration of various programming languages, in C related to storage class specifiers [3] .

Static Data

Global or static data as determined and may be initialized at compile time requires static memory allocation. Static data resides in an object file or in segmentated memory in a data- or bss-segment, dependent on their initialization. For instance, some chess programs keep material- and other lookup tables initialized in their object file and data segment, for huge tables likely by generated source code with appropriate data declarations and static initialization. Assuming the initialization code is (much) shorter than the generated data, others prefer to reduce the size of the object file to initialize stuff located in the bss-segment or elsewhere after program startup.

Dynamic Data

Dynamic data is created during the runtime of a process, it might be allocated from a memory pool (heap), and freed if no longer needed, depending on the framework or programming languages, either explicitly, or implicitly by garbage collection.

Automatic Data

Automatic data and variables like local variables and actual parameters have a limited lifetime inside the scope of a subroutine or block. Automatic variables either reside on the processor stack, or inside a processor register.

Algorithms + Data

Data structures are inherently related to algorithms and their efficiency, as for instance elaborated by Niklaus Wirth in Algorithms + Data Structures = Programs [4] .

Primitive Types

General Purpose

Chess Specific

Scalar integers as numbers, enumerations or simple structures related to Chess and Search basics.

Encoding Moves

Structured Data

General Purpose

Chess Specific

Persistent Data


See also


1960 ...

1970 ...

1980 ...

1990 ...

2000 ...

2010 ...

External Links


Up one Level