Skip to content
Nick Buonincontri edited this page Feb 17, 2018 · 8 revisions

Operators

Arithmetic ops

+ - * / % ^

Relational ops

== != < > <= >=

ID's

([a-z])([a-zA-Z]|[0-9]'_''\'')

Fexpr

id ':' Farg (-> Farg)^*(endline)

Farg

Int
Double
Bool
T

Tensor

T <targ(, targ)*>

literally initialized:

myT : T<n, m>
mtT = [1...n]

"Liberal Tensor"

SV -> Int | id | sv OP sv

Function Declaration and Definition

matProduct : T<a,b> -> T<b,c> -> T<a,c>
matProduct : mat1 mat2 = mat1[i,j] * mat2[j, k]

Scope

matProduct : T<a,b> -> T<b,c> -> T<a,c>;
matProduct : mat1 mat2 = mat1[i,j] * mat2[j, k];
    {
      some expression;
    }

Left of the colon lives in the scope above Right of the colon lives scope of the function Declaration and Definition must be next to each other

Keywords

all the types, and...

if
then
else
main

Comments

// C style comments, one line

/*
More comments
on multiple lines
*/

TensorFlock

Clone this wiki locally