Live data from Hacker News

Zig's new bitCast semantics and LLVM back end improvements

ziglang.org

141–150 of 159 posts

Re: Zig's new bitCast semantics and LLVM back end improvements

#141
Writing linkers must be incredibly rewarding - go has its own, there's mold, there's LLD, there's the OG GNU bfd LD and now Zig has one too! I am sure there's a Rust one too - Wild!

Every one of them is faster than the others too lol! Mold for one tries really hard to be GNU ld and to be useful as an independent linker most have to - I guess Zig/Go ones are purpose built so at least those don't duplicate GNU ld compatibility.

Re: Zig's new bitCast semantics and LLVM back end improvements

#142
post #67

Earlier quoted context omitted.

It's so interesting to read comments like this and contrast them with the "don't read the code" type of vibes out right now. It feels like half of the developer world is optimizing low-level struct packing and the other half is YOLO'ing 300 KLOC Electron apps. Very confusing.

Same as it ever was.

Here's a description of a "real programmer" from all the way back in 1983:

https://users.cs.utah.edu/~elb/folklore/mel.html

Re: Zig's new bitCast semantics and LLVM back end improvements

#143

Writing linkers must be incredibly rewarding - go has its own, there's mold, there's LLD, there's the OG GNU bfd LD and now Zig has one too! I am sure there's a Rust one too - Wild! Every one of them is faster than the others too lol! Mold for one tries really hard to be GNU ld and to be useful as an independent linker most have to - I guess Zig/Go ones are purpose built so at least those don't duplicate GNU ld compa…

Wait till you hear how many programming languages there are

Re: Zig's new bitCast semantics and LLVM back end improvements

#144
post #143

Writing linkers must be incredibly rewarding - go has its own, there's mold, there's LLD, there's the OG GNU bfd LD and now Zig has one too! I am sure there's a Rust one too - Wild! Every one of them is faster than the others too lol! Mold for one tries really hard to be GNU ld and to be useful as an independent linker most have to - I guess Zig/Go ones are purpose built so at least those don't duplicate GNU ld compa…

Wait till you hear how many programming languages there are

Sure, but one might imagine that linkers are generic and reusable, so you can just pick one off the shelf instead of making a new one 1-1 for each language. Empirically this line of reasoning seems to be incorrect.

Re: Zig's new bitCast semantics and LLVM back end improvements

#145

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…

Andrew pushes lots of "social issues" so he has that crowd and they push zig as a way of pushing their social views.

What "social issues" would those be?

Re: Zig's new bitCast semantics and LLVM back end improvements

#146
post #99
post #94

Earlier quoted context omitted.

Why I've moved more to a couple of language/software dev discords and away from Hacker News. Way too much uninteresting AI nonsense on here for a while now.

Would like to join as well if you're willing to share

Usually I bounce between the Zig and Odin discords, as well as the Handmade Network discord.

Re: Zig's new bitCast semantics and LLVM back end improvements

#147
When I first found out about bit fields in C, I was left wondering what the order of bits was in a byte, eventually I convinced myself it doesn't matter, since the byte is the smallest I/O unit, and lived with the fact that casting between bitfields and bytes was UB (or unspecified, I can't remember), and as such, was another thing I wasn't suppossed to do when writing C.

All this to say that Zig just keeps cleaning up and giving well-defined semantics to warts I learned to live with in C.

Re: Zig's new bitCast semantics and LLVM back end improvements

#148
post #55

Earlier quoted context omitted.

you need different packed structs for little- and big-endian data. and casting with little-endian data is a nightmare - you need to reverse-cascade your struct fields to be in accordance with the little-endian bit-pattern. (or have a comptime function that does it for you, of course. but then you lose all declarations for the struct). what should be a simple writing down of a protocol is now a pedantic and error-pron…

Or you just go ahead and forget that big endian ever existed. It's not coming back.

it’s little-endian protocols that require that you juggle your struct fields.

plus, there are still big-endian protocols that will stay for a long time. for example, MIDI clip files in MIDI 2.0 are big-endian.

Re: Zig's new bitCast semantics and LLVM back end improvements

#149
post #143

Writing linkers must be incredibly rewarding - go has its own, there's mold, there's LLD, there's the OG GNU bfd LD and now Zig has one too! I am sure there's a Rust one too - Wild! Every one of them is faster than the others too lol! Mold for one tries really hard to be GNU ld and to be useful as an independent linker most have to - I guess Zig/Go ones are purpose built so at least those don't duplicate GNU ld compa…

Wait till you hear how many programming languages there are

Different programming languages are very obviously not the same thing - different cp command implementations are similar conceptually to having different linker implementations that all do the same thing. But you knew that so not sure if there was a point you were trying to make there.

Re: Zig's new bitCast semantics and LLVM back end improvements

#150

Earlier quoted context omitted.

You may have never done socket programming, or do you use wrapper libs in Zig? Because you have to send the kernel big endian port numbers for example. What do you do if you program a kernel in Zig, or just generally do low level networking? My point is to refute the statement that everyone has agreed to little endian, and so there aren't use cases to want to do conversion. Programs do not exist in a vacuum, most pro…

Well you would, of course, have a mapping layer between wire types and domain types, like in any good codebase. You do the endianness conversion at that boundary, and then you can just send it out.

> You do the endianness conversion

Exactly my point.

Post reply on HN