VITA Language
VITA is a compiled language designed for AI-adjacent systems. It compiles to WASM, interfaces with NNN architectures natively, and ships with a standard library for working with neural tensors directly.
The playground currently runs a partial interpreter for basic expressions and print statements. Full compilation to WASM is in development.
Syntax
Variables
let x = 42
let name: String = "rotvice"
const PI = 3.14159
Functions
fn greet(name: String) -> String {
return "hello, " + name
}
fn add(a: Int, b: Int) -> Int {
a + b // implicit return
}
Control Flow
if x > 0 {
print("positive")
} else {
print("non-positive")
}
for i in 0..10 {
print(i)
}
while cond {
// loop body
}
NNN Integration
import NNN.context
import VITA.inference
bot MyBot {
persona: "helpful assistant"
model: "vita-7b"
on_message(msg: Message) -> Response {
let ctx = msg.context()
infer(ctx, max_tokens: 512)
}
}
Types
Int // 64-bit integer
Float // 64-bit float
String // UTF-8 string
Bool // true / false
List<T> // growable array
Map<K,V>// hash map
Option<T>// nullable value
Tensor // NNN tensor type