Hacker Newsnew | past | comments | ask | show | jobs | submit | gracefulliberty's commentslogin

Sending user data to Anthropic?

Would also like to see the stats of men who do the same.


Everything it's doing it clear and readable. It's just not as easy to write. It streams the bytes to stdout using the default IO interface, and it can fail.

Alternatively, here's a simpler version (prints to stderr).

    const std = @import("std");

    pub fn main() void {
        std.debug.print("Hello, world!\n", .{}); 
    }
In practice, you normally don't want to print messages to stdout. So the increased friction here actually pushes you in a better direction.


the given complicated version's complexity actually just comes from the fact that it's a "more correct" way to write a hello world program, as it manually acquires the stdout File object and acknowledges that printing to stdout can fail. the complexity has nothing to do with stdout vs stderr, you could just use `.stderr()` instead of `.stdout()` (same "friction", it's even the same number of characters). `std.debug.print` is only meant for debugging/development as it gets stderr for you and discards the errors that could happen when writing to stderr.


I meant that the convenient interface only works for stderr. So you aren't accidentally sending debug messages to stdout and if you want to send bytes to stdout you have to do so intentionally and use the right interface.


Both an excellent showcase of the Zig build system and a convenient way to use C libraries within Zig.


Let it be known that this is a spelling mistake I have made for years. I thought I had rooted out of this article. It must have made it back in with later drafts.


To be clear, I'm not accusing you of plagiarism at all. I'm just saying this kind of typo unfortunately doesn't prove anything.


If that's the case, that's not a bad thing. Maybe men who aren't properly bonded with their kids have higher than normal testosterone for some reason?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: