Comparisons and sorting on any strings are done in "natural order", meaning that 1x comes before 10, and m20x comes after m2a
IDs that only consist of integers, that is, 0-9, are considered as automatically generated IDs. For entity mixing, entities with IDs are compared against each other and automatically merged. In general, these IDs should not be stored by the container, but rather iterated over.
IDs that have non-integer characters are considered named Entities. Since named entities are considered as explicitly referenced by the container, they will only be merged against other entities with the same name.
For opcodes that use IDs, if no id specified or the id is null, then the current entity is used. If the id is an immediate value, it accesses a contained entity by that name. If the id is a list, then it starts from the current entity and traverses each contained entity by name, ignoring nulls in the list.
;comments until the end of the line
[#label] [||][@](opcode [parameter1] [parameter2] ...)
The language generally follows a parse tree in a manner similar to Lisp and Scheme, with opcodes surrounded by parenthesis and including parameters in a recursive fashion. The exceptions are that the opcodes list and assoc (associative array, sometimes referred to as a hashmap or dict) may use [] and {} respectively and ommit the opcode, though are still considered identical to (list) and (assoc).
The character # means that the opcode has that label. Multiple labels may be specified on the same node. If the label has any nonalphanumeric character, it may be surrounded by quotations as a string. E.g., #"Some complex label; with \"punctuation!"
If a label is preceeded by more than one #, then it is disabled and thus ignored with regard to its current entity. Some commands will add or remove a # at the beginning to assist ease of specifying labels when creating entities and to help prevent accidental label sharing. If a label starts with a caret (^), e.g. #^method_for_contained_entities, then it can be accessed by contained entities, and they do not need to specify the caret. Parent entities do need to specify the caret (^). For example, if #^foo is a label of a container, a contained entity within could call the label "foo". This adds a layer of security and prevents contained entities from affecting parts of the container that are exposed for its own container's access. Labels starting with an exclamation point (!), e.g. #!private_method, are not accessible by the container and can only be accessed by the entity itself except for by the contained entity getting all of the code, acting as a private label. A label cannot be simultaneously private to its container and accessible to contained entities.
Variables are accessed in from the closest immediate scope, which means if there is a global variable named x and a function parameter named x, the function parameter will be used. Entity labels are considered the global-most scope. If a variable name cannot be found, then it will look at the entity's labels instead. Scope is handled as a stack, and some opcodes may modify the scope.
In addition to the stack scope, there is a target scope, which can be accessed via the target opcodes to access the data being iterated over. Some opcodes will add one or more layers to the target stack, so care must be taken to count back up the target stack an appropriate number of levels if the target is being used directly as opposed to being accessed via a variable.
When code is written, all of the parameters for an operator are in a flattened ordered list. This means that even an associative array or a reference cycle (a data structure that has one or more self-references) will be stored as flattened code. If an operator is preceeded by an @ symbol, then it will be evaluated with regard to data format on load, useful for storing self-referential or graph data structures.
Comments do not affect execution directly, but can be read by code and thus influence execution. They can also be used to store metadata. An entity's root node's comment specifies the name and description of the Entity. The first line of the comment is its name, the remainder of the lines of the comment are the description.
In-order evaluation of parameters of most opcodes are not guaranteed to execute in order, or be executed at all if not necessary, unless otherwise specified in the opcode (e.g., seq, declare, let, etc. all execute in order). It is generally not recommended practice to have side effects (variable or entity writes) in opcodes whose parameters are not guaranteed to be sequential.
If the concurrent/parallel symbol, ||, is specified then the opcode's computations will be executed concurrently if possible. The concurrent execution will be interpreted with regard to the specific opcode, but any function calls may be executed in any order and possibly concurrently.
Each Entity contains code/data via a root node that is executed every call to the entity. An Entity has complete abilities to perform reads and writes to any other Entity contained within it; it is also allowed to create, destroy, access, or modify other entities. The root-most entity has permissions to call system commands and load files, and this is called root permission. These permissions may be set on other entities by an entity with root permission.
Entities may be explicitly named and may be used as code libraries. For example, a library named MyLibrary with function MyFunction can be called as:
(call (retrieve_from_contained_entity "MyLibrary" "MyFunction") (assoc parameter_a 1 parameter_b 2))
Numbers are represented via numbers, as well as ".", "-", and "e" for base-ten exponents. Further, infinity and negative infinity are represented as ".infinity" and "-.infinity" respectively. Not-a-number and non-string results are represented via the opcode (null).
All regular expressions are EMCA-standard regular expressions. See https://en.cppreference.com/w/cpp/regex/ecmascript or https://262.ecma-international.org/5.1/#sec-15.10 for further details on syntax.
Permissions: blank = always, entity = needs entity, root permission = can only be called an entity with root permission
New value: blank = it evaluates to (and potentially modifies) a reference of an existing value, new = it makes a new value and copies if applicable