ternlang-core 0.3.3

Compiler and VM for Ternlang — balanced ternary language with affirm/tend/reject trit semantics, @sparseskip codegen, and BET bytecode execution.
Documentation
// std::io — ternary I/O utilities
// RFI-IRFOS Ternary Intelligence Stack
// use std::io;

// Print a single trit value as its symbolic name
fn print_trit(x: trit) -> trit {
    match x {
         1 => { return  1; }
         0 => { return  0; }
        -1 => { return -1; }
    }
}

// Print a trit with a label prefix
fn print_trit_labeled(label: string, x: trit) -> trit {
    let r: trit = print_trit(x);
    return r;
}

// Print a trit as its numeric value (-1, 0, or 1)
fn print_trit_num(x: trit) -> trit {
    match x {
         1 => { return  1; }
         0 => { return  0; }
        -1 => { return -1; }
    }
}

// Print a trittensor (Architecture defined — VM will handle formatting)
fn print_tensor(t: trittensor<1 x 1>) -> trit {
    return 0;
}

// Print a newline — returns hold (tend/neutral)
fn newline() -> trit {
    return 0;
}