A simple, fast compiled programming language powered by LLVM.
print << and input >> built-in I/Oimport math and import string supportgit clone https://github.com/onecu-21/twit
cd twit
mkdir build && cd build
cmake ..
make -j$(nproc)
sudo cp twitc /usr/local/bin/twit
Use WSL (Windows Subsystem for Linux) ๐
Untested... I think it will work... maybe...
twit hello.twit -o hello
./hello
new int x = 5
new float y = 3.14
new double z = 3.141592653589793
new long l = 9999999999
new bool b = true
new string s = "hello"
new int arr[10]
function add(int a, int b) = int {
return a + b
}
print << "hello world"
print << x
new int x
input >> x
x++ x-- ++x --x
x += 1 x -= 1 x *= 2 x /= 2
x % 2
if (x > 0) {
print << "positive"
} else if (x == 0) {
print << "zero"
} else {
print << "negative"
}
while (x > 0) {
x--
}
for (new int i = 0; i < 10; i++) {
if (i == 5) { break }
print << i
}
struct Point {
int x
int y
}
function main() = int {
new Point p
p.x = 10
p.y = 20
print << p.x
return 0
}
import math
function main() = int {
new double x = sqrt(2.0)
new double y = pow(2.0, 10.0)
print << x
print << y
return 0
}
sqrt, sin, cos, tanlog, log2, floor, ceil, roundpow, fmod, fabsstrlen, strcmp, strcatstrcpy, strncpy, strstr