omega-bridge
Omega-first language interoperability: checked conversion backends and native language bindings
Brought by drakestapleton
omega-bridge / tests / native / g1 / caller.rs
| 1 | // Rust caller for the G1 sample calc: reads "i0 i1" lines, prints "i0 i1 status result" per line. |
| 2 | mod omega_native; // generated by tools/native, nothing typed by hand |
| 3 | use std::io::BufRead; |
| 4 | |
| 5 | fn main() { |
| 6 | for line in std::io::stdin().lock().lines() { |
| 7 | let line = line.expect("stdin"); |
| 8 | let mut it = line.split_whitespace().map(|t| t.parse::<u64>().expect("u64")); |
| 9 | let (a, b) = (it.next().expect("i0"), it.next().expect("i1")); |
| 10 | let mut r: u64 = 0; |
| 11 | let s = unsafe { omega_native::omega_calc(&mut r, a, b) }; |
| 12 | println!("{} {} {} {}", a, b, s, r); |
| 13 | } |
| 14 | } |