StandardML with refinement types + Affirmation -based language
rustc >= 1.75.0cargo >= 1.75.0
To submit your code, create a PR on the dev branch, which will be reviewed later on and merged on main if the feature is stable and legitimate.
Please document all your code, especially the structs fields and the functions by providing their specification. You can get inspirations from the actual code.
Caution
This section, especially the grammar, is subject to changes. Here is the BNF of the language's grammar :
program = expr;
expr = let | app | if-expr | fun;
app = app term | term;
let = 'let' id definition 'in' expr;
definition = ( '::' type_expr | [ ':' id ] '=' expr );
type_expr = ( id | product_type | sum_type | function_type );
product_type = '{' { id ':' id ';' } '}';
sum_type = '|' type_expr { '|' type_expr };
function_type = type_expr '->' type_expr;
fun = 'fun' [ 'ifx' ] { id } '->' expr;
if-expr = 'if' expr 'then' expr 'else' expr;
term = id | literal | '(' expr ')';
literal = numbers | strings | booleans | chars;