122
Points
32
Comments
kouosi
Author

Top Comments

ozgrakkurtJun 25
> Consider, for instance, bitcasting a [2]u8 to a u16. Under the old semantics, the result of this operation depends on the target endian: on big-endian targets, the first array element became the 8 most significant bits, whereas on little-endian targets, the first array element became the 8 least significant bits. Under the new semantics, because we only care about logical bit representation (which is endian-agnostic), the operation behaves identically on every target:

This is a huge mistake. You would never expect something like bitCast to do this.

I don't understand this approach. Why change something so simple and low level to be complicated and high level?

Just don't allow casting to u24, as it makes no sense unless you define u24 to be u32 sized as I think c standard does.

I think this approach as an idea is bad but at least just add another built-in that implements this higher level idea to not break a simple expectation and current behavior?

zamadatixJun 25
This change + the existing packed struct logic will be great for working with bit packed binary headers w/o having to manually twiddle so much about the bit handling along the way.
grayhatterJun 25
> Quite long devlog coming up, apologies—I got a little carried away with this one!

mlugg, please don't apologize for creating something I actually want to read. I'm drowning in low effort garbage, the in depth technical explanation is a refreshing breath of fresh air.

Might as well apologize for creating a language without a garbage collector, sure most people are unwilling to think, but some of us like nice things and are actually willing to apply effort.

simonaskJun 25
Interesting read, even as someone who isn't using Zig.

I wonder, these arbitrary-width integers... Is it actually even really worth it? My intuition is to prefer manually packing/unpacking things instead (in any language, even C that has bit width for struct fields), because it gives me a better mental picture of the code that is actually generated. Particularly for something like an signed odd-bit integer - what kind of code gets generated for sign-extension, a presumably common operation?

Does anybody have other experiences with them, one way or the other?

epolanskiJun 25
OT: I'm always surprised at how popular Zig discussions get here, or Youtube and other medias.

Don't get me wrong, I love Zig and I think it's a great C replacement, but I'm very confused on why C3 or Odin rarely get any attention at all, despite being in the same C-replacement crowd.

But still surprised at what Zig does better than these other projects? Is Andrew much better at marketing/promoting the language? He's very hard to dislike.

QuaternionsBhopJun 25
Is pasting em-dashes everywhere some kind of inside joke?
Visit the Original Link

Read the full content on ziglang.org

Source
ziglang.org
Author
kouosi
Posted
June 25, 2026 at 02:19 PM


More Top Stories

scrollprize.org Jun 25
A Herculaneum scroll has been read for the first time
8021 commentsby verditelabs
Details
newsroom.ibm.com Jun 25
IBM debuts sub-1 nanometer chip technology
3917 commentsby porridgeraisin
Details
dev.karltryggvason.com Jun 24
You can't unit test for taste
18168 commentsby kalli
Details
hackernewstrends.com Jun 25
Show HN: I made Google Trends for Hacker News by indexing 18 years of comments
414118 commentsby ytkimirti
Details
reuters.com Jun 25
Apple raises prices of MacBooks, iPads
274476 commentsby virgildotcodes
Details
yllan.org Jun 25
OS9Map
494 commentsby LaSombra
Details
👋 Need help with code?