An implementation of a C-style statically typed language that compiles down to a bytecode which is then interpreted.
- Lex basic scripts
- Parse arithmetic expressions
- Lex and parse comparison expressions
- Lex and parse variables
- Parse statments
- Type check statements and expressions
- Compile things so far
- Compile and run if-else statements
- Compile and run functions
- Compile and run native functions
- Compile and run while loops
- Use Main function as entry point to program
- Implement arrays
- Implement strings
- Implement multidimensional arrays
- Implement structs
- Implement struct inheritance
- Interfacing with C/C++ libraries
- Serialise and de-serialise Functions in order to seperate compilation and execution
- Optimiser
- Evaluate constant expressions at compile time
- Propagate constants through program
- Keep performing optimisation passes until the AST does not change
- Control flow optimisations
- Peephole optimisations of bytecode
- Multiple file programs
- Verification
- Lex and parse verification statements
- Push precondition through bytecode for a subset of the language
- Verify output
- Improve garbage collector heuristics to minimise loss of program execution time
- Overloading of functions where the overloaded types are assignable to each other
- MBE:
function void Foo(int i){...} function void Foo(double d){...} Foo(3.14); // would have called the int version // not the double version as it appears // first and ints can be assigned to doubles
- MBE:
- Put parsed library functions into different container than normal functions
- Implicit type conversions for elements of braced initialisers are not implemented
- MBE:
Array<int> arr = {3.141, 1.618, 1.414}; // compiled as: // LOAD_DOUBLE 0 (value 3.141) should be --> LOAD_INT 0 (value 3) // LOAD_DOUBLE 1 (value 1.618) should be --> LOAD_INT 1 (value 1) // LOAD_DOUBLE 2 (value 1.414) should be --> LOAD_INT 2 (value 1) // etc.
- MBE:
Hello World!
function void Main()
{
Print("Hello World!");
}A simple program to calculate the Fibbonacci numbers
function int Fib(int n)
{
if (n < 1)
return n;
return Fib(n - 1) + Fib(n - 2);
}
function void Main()
{
Print(Fib(10));
}function int Square(int x)
(|x = x_0|)
{
return x * x;
(|x_0 * x_0|)
}