Toy programming language

From Wikipedia, the free encyclopedia
Jump to: navigation, search

A toy language is a computer programming language that lacks the requirements to create reliable, maintainable computer programs in a production environment. Categorizing a programming language as a toy language is difficult, however, as the definition is often subjective. Also, a "toy" language is distinguished from domain-specific languages and esoteric programming languages. A "problem domain" language is a limited programming language made for a specific purpose, such as the PostScript language used in PDF documents, or the limited instruction set used to program the multiple core graphics processing unit in a video card. An "esoteric language" is a programming language designed to test the boundaries of computer programming language design, as a proof of concept, as software art, or as a joke, such as Befunge or LOLCODE.

Toy languages exclude "one time" use compilers and interpreters, such as bootstrapping compilers which are used to create the initial compiler for a language unavailable on the target machine. The bootstrap compiler changes the source into something the bootstrap machine can run, and once the bootstrap compiler creates the initial compiler, it can compile itself.

One way to consider if a language is not a toy is to consider the question, "Would a professional programmer with several years of experience seriously consider using the language as a means to provide a reasonable, cost effective solution for a customer's problem?" Also, as human beings have learned more about programming concepts, language translation, and problem domains, the range of expected capabilities of programming languages is likely to increase—and industry perceptions may downgrade some languages considered professional-class to toy-class languages. While a language that could do simple sequential file read and file write with some processing of the material read may have been adequate for production twenty or thirty years ago, some might now consider programming languages without random-access file capabilities or SQL toy languages.

Some people consider older versions of languages toy languages because they're unaware of modern features in the latest versions of those languages. The original BASIC programming language lacked a number of features (e.g., longer variable names, multiline functions, and procedures), but was a considerably less capable language than current dialects of BASIC such as Microsoft Visual Basic, Gambas or Free Basic. Also, the original Pascal language lacked some essential features, such as strings, but current Object Pascal compilers such as Delphi or Free Pascal provide a complete professional language system capable of solving any problem that C or C++ could handle.

Languages such as Brainfuck and Whitespace are both considered esoteric programming languages. They are Turing complete, which means they can compute any computable function. Logo is a toy language. Its goal was originally to create a math land where children could play with words and sentences. For a long time, the GNU Compiler Collection was shipped with a toy programming language called Treelang which was essentially C without advanced features such as pointers, arrays, and records.


Though a toy language may be mathematically complete, it is usually limited in one or several ways. It may not support a full range of programming constructs or concepts. It may lack a full set of support libraries required for production-quality programs.


Toy languages are used in computer language research. Some are frameworks for researching new programming constructs, or prototypes for new language concepts or paradigms. Others are learning or demonstration tools—e.g., in universities, for programming constructs and techniques not available in mainstream languages, or as an exercise in building a language from scratch.

See also[edit]

Toi (programming language)