Examples
Πού θα βρείτε runnable Sounio code στο repo.
Examples
Αυτό το repo περιέχει δύο καλές πηγές “known-good” Sounio code:
tests/run-pass/: μικρά, στοχευμένα προγράμματα που χρησιμοποιεί το CI (καλύτερο για να μάθετε σύνταξη)examples/: μεγαλύτερα demos και domain code (μερικά μπορεί να είναι aspirational ή να απαιτούν feature flags)
Run a Test Fixture
souc run tests/run-pass/hello.sio
souc run tests/run-pass/for_in_loops.sio
souc check tests/run-pass/async_basic.sio
COVID 2020 Kernel (typed refusal)
Use the March 2020 kernel to demonstrate temporal + epistemic constraints at compile time:
souc check tests/run-pass/covid_2020_kernel.sio
Expected behavior: compiles only when validity and confidence constraints are satisfied.
Vancomycin Propagation (clinical safety)
Run the propagation demo and refusal fixture together:
souc check tests/run-pass/vancomycin_propagation.sio
souc check tests/compile-fail/vancomycin_low_conf.sio
Expected behavior:
- propagation demo passes and shows uncertainty propagation
- low-confidence prescription fixture fails at compile time (
epsilon)
A Few Canonical Snippets
Hello world:
fn main() with IO {
println("Hello, Sounio!")
}
Match:
let y = match x {
0 => 10
1 => 20
_ => 30
}
Explicit Knowledge<T> unwrap:
let k = Knowledge { value: 42.0 }
let x: f64 = k.unwrap("accepted for demo")