News for hackers. Stuff that matters.
Re:Show HN: Tiny 1k Rust binary on Windows by colejohnson66 on Tuesday December 01, 2020 @03:47PM (#25269675)
Rant:

And below libc is probably X or Wayland which tells the kernel where to put pixels. And below that is the kernel and graphics driver which figures out how to do that and communicates it to the GPU. And below that is the actual GPU which figures out how to modulate an array of pixels into an HDMI signal. When do we stop quibbling about the size of binaries? It’s pointless to point out that small code relies on other abstractions. No one complains about tiny demo scene programs using tons of other stuff built into the OS. So why here?

Re:Show HN: Tiny 1k Rust binary on Windows by naikrovek on Tuesday December 01, 2020 @11:10PM (#25273156)
Your understanding of computers does not seem correct at all... But maybe it's my understanding that wrong. I don't know.

C64 demos and 8088 DOS demos use very little OS infrastructure. Obviously things like JavaScript demos do.

The challenges presented by a particular piece of hardware or software in the demo scene are chosen for different reasons.

Sometimes, the demo author wants to show how well they can use the existing OS infrastructure. Sometimes they want to show what can be done without it. In both cases, small sizes are impressive.

Re:Show HN: Tiny 1k Rust binary on Windows by pornel on Wednesday December 02, 2020 @06:27AM (#25275435)
I'm not complaining that a Hello World exe doesn't come with its own operating system.

It's just worth knowing when you compare exe sizes that C doesn't have an order of magnitude more efficient code generation. It just had a >30-year head start to get its standard library shipped with every operating system. Other languages typically don't have that advantage, and either have to reuse libc, or take a hit from statically linking their own libstd.

Re:Show HN: Tiny 1k Rust binary on Windows by adkadskhj on Wednesday December 02, 2020 @01:57PM (#25279957)
The entire exercise is an attempt to compare apples to apples.

In your example, both the C bin and Rust bin are using X, GPU, etcetc - so they warrant no distinction. So what is different? What is included in the Rust binary that isn't in the C? Because that's what is being tested in these types of comparisons.

This difference may be because some language included inefficient instructions - has bloated includes, etc. Or it could be because you're comparing Apples to Oranges, eg one ships with libc in the binary, and one dynamically links to it.

Re:Show HN: Tiny 1k Rust binary on Windows by colejohnson66 on Wednesday December 02, 2020 @03:01PM (#25280840)
I’m not attempting to compare apples and oranges. I’m ranting about how almost every time someone posts something about tiny programs (like 100 line JS programs or wherever), someone has to chime in about how they’re able to do something so small because they’re using all these abstractions (code) below them and, as such, it’s not an achievement.

Again: it was just a rant.

Re:Show HN: Tiny 1k Rust binary on Windows by adkadskhj on Wednesday December 02, 2020 @05:22PM (#25282529)
Specifically that your rant is here because the Parent comment mentioned Libc - but this is because the Rust version isn't using that - but the C lib is.

So it's Apples to Oranges because they're fundamentally doing different things, and yet we're comparing their Line Count. That's not only reasonable, it's necessary if you want an Apples to Apples comparison.

That's why we're not concerned about the code to render with GPU or some other junk - but we are fundamentally talking about two programs that do different things - but then comparing their line count.

Your rant may be valid in other cases, but it seems super off base here. Your rant has, imo, nothing to do with what's happening in people pointing out the discrepancy.