Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tsarchghs/mt

MT is a high level programming language.
https://github.com/tsarchghs/mt

c compiler programming-language

Last synced: 9 days ago
JSON representation

MT is a high level programming language.

Awesome Lists containing this project

README

        

# MT
The compiler skips the AST phase and produces the output based on only the tokens given.
Currently it's in alpha stage.

Usage: ```./compiler ```

For the compiler to work you must have C's GCC compiler.

Examples:
Print 1 to 10
```javascript
var b = 1;
while b < 11:
print(b);
b += 1;
end
```
output:
```
1
2
3
4
5
6
7
8
9
10
```
```javascript
var child1 = "John";
var child2 = "Johnson"; // creative.. I know :)
var child1_age = 16;
var child2_age = 16;

if child1_age > child2_age:
print(child1_age);
end
elif child1_age == child2_age:
print("They are the same age");
end
else:
print(child2_age);
end
```
Output: ``` They are the same age ```

Dynamic typing:
```javascript
var b = "DSASDA";
print(b);
b = 31.321;
print(b);
b = 52;
print(b);
```
Output:
```
DSASDA
31.321
52
```
Functions: (alpha/buggy)
```javascript
function squareOfTwo():
print(4);
end
squareOfTwo();
```


    Why is gcc required for the compiler to work?
  • Because MT's compiler (ab)uses GCC's C extension that allows function definitions inside of main function .