logoalt Hacker News

ozgrakkurt • yesterday at 10:31 AM • 2 replies • view on HN

It already is bloated.

I'm not saying it is a bad language as I use it since 9 years and still write new code in it.

But if you compare writing an bump allocator in c or zig vs rust, it is comically bloated. Same applies to anything like a vector or a hashmap or anything else low level.

You get a binary that is multiple megabytes if you just write a webserver on the path of least resistence.


Replies

chiffaa • yesterday at 11:24 AM

May I ask if you're comparing apples to apples (statically linked everything) in the last case? I'm not very well versed in C or C++, but I do know that a common practice there is dynamically linking the world, so I'm curious if the size difference stays if you link statically in both cases?

➕ show 2 replies
koverstreet • yesterday at 10:36 AM

the Rust version of bcachefs has an object size 50% bigger than the C version, without trying to optimize for object size and with a whole bunch of new code to replace things that we used to get from the kernel but weren't Rust.

Even if that doesn't shrink I consider that a very good tradeoff for what we're getting.