A compiler for the programming language Baulu. Baulu tries to achieve Python like syntax, with C like type safety, while trying to be memory safe without significant performance overhaults. It's a compiled language of course, that's why it has a compiler in the biggening.
the function declaration grammer uses the keyword function followed by an
identifier, followed by paramters defined with let TYPE IDENTIFIER seperated
by comas and all inside round brackets, followed by the return type if needed,
then two colums. an example would be:
function foo(let int x) => int:function main() => int:function is_prime(let int n) => bool,function sleep(let int seconds):
this language uses the offside rule using tabs , you can also optionally use curly brackers for inline blocks, example:
if x:
return 0;
if x: {return 0;}
note: only use tabs for nesting.
- return statements:
return expr;. - while statements:
while expr:. - if statements:
if expr:.
These can be done in a statement that consist of an expression and a
semicolon, as in expr;, the operation you can do are = for assignment,
and [+,-,/,*,%] for Arithmetic.
you need to use the let keyword followed by a type followed by an
identifier, there is only int for now.
all veriables need to be assigned.
This project will not gurantee backwards support compatabiliy for anything done with previous version of it. If you would like to add new stuff. you can do a pull request or add and issue, and I would try to hopefully read all of them.
this repositry is for now an attempt to recreate bauluc (if you have see it) in rust, and all features aren't there (even in this readme) aren't there.