News for hackers. Stuff that matters.
Re:Bugs in Hello World by nextaccountic on Friday March 11, 2022 @09:59AM (#30640702)
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
Re:Bugs in Hello World by dralley on Friday March 11, 2022 @06:20PM (#30647350)
Or Zig which tries to make it easy to actually handle those errors.