Sisal with type inference and indent structuring!
Current status: early alpha
(some programs work but test coverage is very low)
The main difference between ordinary Sisal and this version that is does not require types to be explicitly specified and uses indents instead of end function stuff:
conv = f(m, a, n, x)
for i in [1..n-m+1]
returns array of for j in [1..m]
returns sum of a[j] * x[i+j-1]
main = f(m, cycles)
let
a = for i in [1.. m] returns array of i
x = for i in [1.. m * cycles] returns array of i
in
conv( m, a, m * cycles, x )
Please read language overview if you want to know more.
A set of test programs with results is available here. More complex examples are here.
- f (function)
- let in
- if elseif else
- for in
- for while
- for repeat
- arithmetics + - * / %
- sum, product, array, stream, last, max, min
to setup:
npm install
or
make setup
to run tests:
make test
to compile:
make compile
to run sisal program:
node ./build/sisal.js <program.sis>
to output computation graph in graphML format:
node ./build/sisal.js <program.sis> --graph
for example:
node ./build/sisal.js ./test/programs/if.sis --graph
Please, feel free to create issue or make contribution to this software!