aboutsummaryrefslogtreecommitdiffstats
path: root/bytecode/src/main.rs
blob: b5a05ef777fafadd9f495acdd26561bbdaa1cb41 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
mod bytecode;
mod encoding;
mod heap;

use std::io::Read;

fn main() {
    let mut buf = Vec::new();
    std::io::stdin().lock().read_to_end(&mut buf).unwrap();
    let prog = encoding::decode(&buf).unwrap();
    let exit_code = bytecode::eval(&prog).unwrap();
    std::process::exit(i32::from(exit_code));
}