Summatciin is an esolang by User:BoundedBeans which depends on summations to do looping.

Syntax[edit]

Parentheses in Summatciin are replaced with double square brackets (just to be different).

All statements end when they encounter a double question mark.

A variable declaration (one of two statements in this language), takes the form:

let (name): (expression)??

A file can be imported with:

import (URI)??

Yes, a URI. You are allowed to import from the internet, or even a data URI (the type of the data URI should be text/plain). In this URI, @@@@@ is replaced with the current path of directories leading to the current file, without an ending slash. (file:///@@@@@/lib.txt will use the file lib.txt in the same folder, with localhost as the host)

Names in this language can take one of these schemes:

(lowercase letter)
(uppercase letter)_(literal integer)
#(sequence of uppercase letters)# [reserved for built-ins]

Variables inside of namespaces can be accessed and reassigned, but only if the namespace has been assigned to a variable. It uses this form:

(namespace name)\(inner name)

The namespace name #THIS# refers to the enclosing namespace.

Names without that refer to global variables. If you want to modify variables local to the current namespace, use #THIS#.

The function #ENCLOSED#, when applied to a number n, refers to the namespace n levels of enclosing above #THIS#. When applied to 0 or a negative number, it refers to #THIS#. You can assign it to a variable to access it. Note that this returns the same namespace object, so changes to the result will result in changes otherwise.

The inner name could be another namespace access.

Built-ins starting with Z are reserved for custom built-ins depending on the implementation.

Newlines, carriage returns, vertical tabs, and form feeds are completely removed from the code before running. Tabs are replaced with spaces.

Types[edit]

There are a few types in this language.

Operators[edit]

There are very few operators:

+ - Addition of two numbers.
    Applying the function O_'0x1 in the namespace.
    Applying a function on the left hand side to a namespace
      on the right. The values in the namespace should share
      the names with the parameters in the function.

    This has the highest precedence.
    This is not commutative or associative, unless you're dealing
      only with integers.

^ - The summation operator.
    Takes in a function on the left side, and a namespace
    on the right. The namespace should include a variable
    x (which is the starting value), and i (which is the 
    ending value). The function should take in a single parameter, x,
    which is a namespace containing the current index in variable x.
    (Can be accessed with x\x)
    It's a namespace because it makes it a references, allowing
    x to be reassigned, which this operator will check for and skip
    back or forwards. Note that if it skips back, all results between
    the current point and the backwards point will be deleted,
    preventing a memory leak.

    It will go through each of the numbers,
    apply the function to them, and finally apply the addition
    operator to all of them. 

    This has the second highest precedence.
    This is not commutative or associative.

Built-ins[edit]

Examples[edit]

Hello world[edit]

let L_0x1: {(
  let #THIS#\o: 0x6C??
  let #THIS#\f: 0x0??
)}??
let O_0x1: {(
  let #THIS#\o: 0x6F??
  let #THIS#\f: 0x0??
)}??
let h: #OUT# + {(
  let #THIS#\o: 0x48??
  let #THIS#\f: 0x0??
)}??
let e: #OUT# + {(
  let #THIS#\o: 0x65??
  let #THIS#\f: 0x0??
)}??
let l: #OUT# + L_0x1??
let l: #OUT# + L_0x1??
let o: #OUT# + O_0x1??
let s: #OUT# + {(
  let #THIS#\o: 0x65??
  let #THIS#\f: 0x0??
)}??
let w: #OUT# + {(
  let #THIS#\o: 0x77??
  let #THIS#\f: 0x0??
)}??
let o: #OUT# + O_0x1??
let r: #OUT# + {(
  let #THIS#\o: 0x72??
  let #THIS#\f: 0x0??
)}??
let l: #OUT# + L_0x1??
let d: #OUT# + {(
  let #THIS#\o: 0x64??
  let #THIS#\f: 0x0??
)}??
let e: #OUT# + {(
  let #THIS#\o: 0x21??
  let #THIS#\f: 0x0??
)}??

Truth-machine[edit]

let t: #IN# + {(let #THIS#\f: 0x0??)}??
let F_0x1: #IF# + {(
  let #THIS#\a: t??
  let #THIS#\b: {{; {(
    let #THIS#\r: {{
      x; {(
        let #THIS#\x\x: 0x1??
        let #THIS#\r: #OUT# + {(
          let #THIS#\o: 0x1??
          let #THIS#\f: 0x1??
        )}??
      )}
    }} ^ {(
      let #THIS#\x: 0x1??
      let #THIS#\i: 0x2??
    )}??
  )} }}??
  let #THIS#\c: {{; {(
    let #THIS#\r: {{
      x; {(
        let #THIS#\r: #OUT# + {(
          let #THIS#\o: 0x0??
          let #THIS#\f: 0x1??
        )}??
      )}
    }} ^ {(
      let #THIS#\x: 0x1??
      let #THIS#\i: 0x1??
    )}??
  )} }}??
)}??
let a: F_0x1 + t??
let o: a + {()}??