Stream - Syntax-Oriented Language
Changing syntax of programming languages
1. Reversed assignment operator a + b -> a
Allows assignment to flow from left to right like we write
in more natural direction
2. Tagging keywords {while} ... {/while}
This allows to easy introduce new keywords into language
and to easy find mistakes in control flow of programs
3. Reversed function declaration {fun} int a, b -> f int and call a, b -> f
These changes allow to combine input and output in one line
which is also more natural
Functions
{module} Euclidean ! comment
{fun} int a, int b -> euclid int ! function with type int
{while} b!= 0
{if} a > b
a - b -> a
{else}
b - a -> b
{/else}
{/if}
{/while}
{return} a {/return}
{/fun}
{fun} string args[] main int ! main function
in -> a, b -> euclid -> out
! combined input and output and function call
! here is introduced streamlined logic
! from left to right like we write
{/fun}
{/module}
File System
f -> (name, type, options) ! file definition
f -> open
f -> close
f -> var ! read from file
var -> f ! write to file
Concurrent Function
{cofun} int a, b -> f1 int... ! function declaration
. . .
{cofun} int c, d -> f2 int...
{cofun} int g, h -> f3 int...
! run in parallel
a1 b1 -> f1 || c1 d1 -> f2 || g1 h1 -> f3
Dynamic Function
Dynamic function is function that can take
another function as a parameter
Declaration
{fun} int a1, int b1 -> f1 int ...
{fun} int a2, int b2 -> f2 int ...
{fun} int f1, int f2 -> f int dynamic ...
or
{fun} fun f1, fun f2 -> f fun ... ! fun is a type
Call
f1 , f2 -> f
Implementation
This is a general purpose language
It should have written in Rust compiler
This way it will be fast and secure
Comments
Post a Comment