ManV, an other compiled programming language intended for writing algorithms.
- Make ManV a compiled language (By generating assembly code)
- Implement Constant/Variable declaration
- Implement basic math operations (mul, div, add, sub)
- Implement syscall keyword for interacting the system
- Implement basic pointers
- Implement binary operations like right shift, left shift ...etc
- Implement memory manipulation
- Implement if-else conditions
- Implement while loops
- Implement functions
- Implement the 'include' keyword
- Write the ManV stdlib
- Port some C libraries (raylib) to ManV
int // Integer type
float // Float type
str // String sequence
array // Arrays
int x = 1;
float y = 0.1;
int c;
// If we want to increase or decrease the variable's size
// we do the following:
size_inc x, 10; // Increase the size by 10
size_dec y, 10; // Decrease the size by 10
// To empty or delete a variable from memory
emt x // Empty the variable x from its value
del x // Delete the variable x from memory
int x = 10;
int y = 2;
int mul_res: int;
int add_res: int;
float div_res: float;
int sub_res: int;
mul (x, y) into mul_res; // Multiplication
add (x, y) into add_res; // Addition
div (x, y) into div_res; // Division
sub (x, y) into sub_res; // Subtraction
to create a pointer, you can use the ptr keyword:
int* x;
pointers passing law:
| manv | assembly |
|---|---|
| text | [text] |
| &text | text |
| *text | [[text]] |
ManV provides a keyword called syscall which you can use to directly make syscalls.
the syntax for syscall is the following:
syscall SYS_NUM *args, ERR $ERR;
An example usage, this is a simple call to sys_exit:
int sys_exit = 60; // sys_exit
int exit_ok int = 0; // Exit code 0
int errVar; // Error reporting
syscall sys_exit exit_ok, ERR errVar;
Conditions in ManV work the same in any other language.
int x = 10;
int errVar;
if (x == 10) {
syscall 1 1 "Hello World" 11, ERR errVar;
}