2 ms·
This just demonstrates that C is an awful programming language for writing correct programs. Compare this with Rust, where the usual hello world will just do t
by nextaccountic 5y ago
This just demonstrates that C is an awful programming language for writing correct programs.
Compare this with Rust, where the usual hello world will just do the right thing:
$ cat > a.rs
fn main() {
println!("Hello World");
}
$ rustc a.rs
$ ./a
Hello World
$ echo $?
0
$ ./a > /dev/full
thread 'main' panicked at 'failed printing to stdout: No space left on device (os error 28)', library/std/src/io/stdio.rs:1187:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
$ echo $?
101
- dralley 5y agoOr Zig which tries to make it easy to actually handle those errors.