MPL2 Manual
Algebra - linear algebra primitives and basic algebraic algorithms.
Algorithms - general purpose algorithms.
Containers - collections of data items.
Control functions - stack, flow, and functional control.
Builtins - MPL Easy's common mathematical functions, bitwise and conditional operators, object control, flow control, utilities, memory management sections.
IDE is a web-based development environment for MPL Easy
Examples page provides some examples of how to use MPL Easy Language and demonstrates some key concepts.
Grammar - RR diagram is a visual representation of MPL Easy grammar and the corresponding .ebnf file.
Offline version of this site, that includes all documentation pages as well as in-browser IDE.
Basic syntax
MPL Easy language uses postfix notation. It means that we can put elements on top of stack and call operations without specifying arguments directly in the call syntax. Each operation works with stack contents. For example, in classic notation, we write
and it means that first, we calculate 3*4 because
This snippet puts 2, 3, 4 to stack. Then
String literals are written in double quotes, e.g.
Variables
Each word that ends with
For example:
creates variable with name
creates two variables:
creates
Brackets
For example:
makes a builtin-list with two elements 1 and 2.
makes a builtin-list with the same two elements 1 and 2 (1 will be pushed after calculating
again makes a builtin-list with the same two elements 1 and 2, because the inner loop pushes two numbers to stack.
You can access builtin-list elements by index
For example:
makes a structure with two fields with values 1 and 2. You can get them by index or by
You can also change any element of a structure by
makes a structure with two fields,
For example:
pushes 3 to stack.
Special fields
Example:
If you want push a structure to stack without calling the code, use
For more information, you can check out the description of pfunc or take a look at examples 40 and 41.
For more advanced examples, please visit examples page.