Universal definition for programming languages

From Esolang
Jump to navigation Jump to search

This page is a attempt for a universal way of defining any esolang or normal programming language, but it isn't complete.

Special variables

First,are special variables.

  1. d, position of the data pointer for cell based languages.
  2. c, code pointer.
  3. s, stack pointer for stack based languages.
  • If there is a * following one of these, it is describing the value at that point.
  • Data pointer or code pointer (or both) are higher dimensional and must be added with a vector in higher dimensional languages.

Functions

Functions are made of 2 parts: a Boolean and a operation. (Booleans are optional they just always return true if not defined)

If the Boolean returns true, the operator will be run.

Boolean structure

When a Boolean is defined, it always is contained between two | .

There are 6 Boolean operators, being

  • >
  • <
  • =

Operator structure

An operator simply takes the values at the right hand side of the equal, and replaces it with the left.

Multiple functions

If you want to execute multiple functions in a instruction, you put commas between them. (The functions execute left to right)

Instructions

To define a instruction, put all the functions of the instruction in square brackets then put the instruction name then equal sign then the functions and brackets.

Languages

To define a language, you do the same as instructions, but with instructions instead of functions.

Definitions

There are currently no definitions, but you can add your own!