Skip to content

Joachim-barre/jolang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

702 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jolang

A jit interpreted language created by joachim barre

variable are i32 by default
the types are :

  • i128
  • i64
  • i32
  • i16
  • i8

file formats

extention description
.joo compiled jolang object
.jol source code

syntax

TODO better documentation

a source file currently looks like that:

// this is a line comment
/* block comment*/
builtin_function(arg1, arg2); // call to a builtin function
var varible; // variable declaration default value is zero
varible = input(); // variable assigment
if (varible == sqrt(4)) { // if statement
    print(variable); 
} else {
    return 1;
}
var i = 0;
while(i <= 4) {
    i = i + 1;
    print(i*i);
}
loop {
    var v = input();
    print(v-1);
    if ( v < 0 ) {
        break; // exit the loop
    }else 
        continue;
}
return 0; // exit the program with exit code 0

these builtin functions are currently available:

name arg count description
print 1 print a variable to stdout
input 0 read a variable from stdin
pow 2 first argument to the power of the second
randint 2 generate a random interger between arg1 and arg2

binary object format

the generated binary object follow the format described in : bytecode_spec.md

About

A simple JIT interpreted langage written In rust

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages