Data-structured language

From Wikipedia, the free encyclopedia

A data-structured language is a programming language in which the data structure is a main organizing principle, representation, model, for data and logic (code) alike, in which both are stored and operated upon, i.e., program data and logic are structured and operated on in the same way, by the same representation.

These are generally well suited to reflection and introspection, and are more consistent in some ways, than many other languages. This makes them easier to learn, and to program in for the set of problems which naturally fits, maps to, a language's data structure. Where this occurs, some types of programming, or programming some types of problems, becomes trivial. For the set of problems which do not naturally fit a language's data structure, programming may be no easier than in other languages. For the set of problems which naturally conflict with a language's data structure, programming may be harder than in other languages.

In programs written in some data-structured languages, when an instance occurs of the type of data representation which forms the basis of the language, then such instance is treated as a special case of quoted program.

A similar concept based on consistency exists in some object-oriented languages, called "pure", which use a consistent object model: everything in them is treated uniformly as an object, from primitives such as characters and punctuation, all the way up to whole classes, prototypes, blocks, modules, etc.

[edit] Variants

Three main classes of data-structured languages exist, determined by the type of data structure on which they are based.

Array-based

List-based

Stack-based (open stacks)

Some languages can statically link data inline with instructions. These can be considered data-structured, in the most primitive way. Some Assembly languages can do this.