Live data from Hacker News

Zig: Build System Reworked

ziglang.org

61–70 of 263 posts

Re: Zig: Build System Reworked

#61
post #8

After having used Zig for a couple of months now I am convinced it is a fantastic tool language. You just pick it up to hack some idea together freely. Every time I hit a wall, I find the creators have thought of it already and offers comfort. But nothing gets in your face how to use the programming language "correctly". For me it is now the go-to "tinker in my garage" language.

> But nothing gets in your face how to use the programming language "correctly".

It doesnt let you have unused variables and theres no multiline comment support. These are fairly significant productivity issues for me

Re: Zig: Build System Reworked

#62
post #49

Is there any proposed timeline for a stable release? Big features like the recent async IO shows the language is very unstable right now.

nitpick: The language is pretty stable, what changes is the standard library.

Re: Zig: Build System Reworked

#63
post #27

Earlier quoted context omitted.

No, I get that, but Zig being low level is kind of why I don't get why it would be a good tinkering language? When I want to tinker, I just want my logic to work, first of all. In 9 cases out of 10 that means going for high level. Even if the resulting code works with low level things like binary structures.

You have a weirdly restrictive definition of "tinker"

Not really?

I've been places, from embedded bare metal to ML AI, and that "embedded bare metal" end is the one place I don't use Python directly in. Embedded bare metal is just ruled by C forever.

Bit of a shame, because C is kind of bad at its job, but nothing else has the "compatible with everything" badge of honor.

The tooling around embedded devices though? Python.

Re: Zig: Build System Reworked

#64
post #18

Earlier quoted context omitted.

Have you ever thought "Ugh, this bit of Python code is running much slower than I expected on my computer. Wonder if anyone has written a native library for this"? That's probably the closest use case for someone who matches your description -- a language that is much more ergonomic, much more 'modern' feeling (in all the good ways), while still extremely compatible with C. As for the language itself, it's going to b…

Rarely. Most tinkering tasks just don't have enough heavy duty computation in them to as much as strain a modern CPU. And most of the rest are covered by packages like numpy or pytorch. For the rare exceptions, I make a C lib and call into it to get my numbers crunched. I get that Zig is a viable replacement for C there. But I don't see it replacing Python.

> For the rare exceptions, I make a C lib

The problem is that most people using Python don't have enough expertise in C to do the same.

It also kinda destroys the argument that Python is good if your solution for performance is to use a different language alongside it.

Re: Zig: Build System Reworked

#65
post #18

Earlier quoted context omitted.

Have you ever thought "Ugh, this bit of Python code is running much slower than I expected on my computer. Wonder if anyone has written a native library for this"? That's probably the closest use case for someone who matches your description -- a language that is much more ergonomic, much more 'modern' feeling (in all the good ways), while still extremely compatible with C. As for the language itself, it's going to b…

Rarely. Most tinkering tasks just don't have enough heavy duty computation in them to as much as strain a modern CPU. And most of the rest are covered by packages like numpy or pytorch. For the rare exceptions, I make a C lib and call into it to get my numbers crunched. I get that Zig is a viable replacement for C there. But I don't see it replacing Python.

Even if you are fine with Python's speed, its memory consumption DOES effect things and can be an extraordinary pain when you need to fit the result of your tinkering in any sort of constrained environment.

Re: Zig: Build System Reworked

#66
post #8

After having used Zig for a couple of months now I am convinced it is a fantastic tool language. You just pick it up to hack some idea together freely. Every time I hit a wall, I find the creators have thought of it already and offers comfort. But nothing gets in your face how to use the programming language "correctly". For me it is now the go-to "tinker in my garage" language.

> But nothing gets in your face how to use the programming language "correctly". It doesnt let you have unused variables and theres no multiline comment support. These are fairly significant productivity issues for me

What do you like to ise those features for?

Re: Zig: Build System Reworked

#67
post #42
post #24

I just upgraded some code to Zig 0.16.0 and I am actually really happy with the results. It impacted A LOT of things, but the changes were actually very good and seems to have set the language for a bright future, especially with the new IO mechanism which allows supper efficient code that looks good whether it's implemented single-threaded, multi-threaded or just via an event loop! If you haven't tried Zig since 0.1…

the “(super) efficient” is not there yet. Io is still dynamic dispatch with multiple layers of indirection. afaik it’s slower than before. the upcoming releases are expected to provide a solution to this “dispatch is comptime-known, but still dynamic” problem, and drop the loses in efficiency.

The parent seems to be talking about efficient code style, not necessarily performance implementation, as they go on to discuss how it looks.

That is, I think the point was DevX not io performance.

Re: Zig: Build System Reworked

#68
post #46

Bun is moving towards rust but does this also help bun's compilation times? https://ziggit.dev/t/bun-s-zig-fork-got-4x-faster-compilatio...

bun seems to be committed to slop rust already. so, with their ethic, maybe we should just disassociate them from zig and let them go realize their slop dreams? zig is on its way to improving compilation times in its own pace and does so for the benefit of the project and everyone involved, so what is left to care for about bun by anthropic’s past?

I bet they'll ultimately reverse course on this, or the there will be a bun / zig fork becomes the de facto bun. Despite what the influencers say, I'm convinced you cannot vibe code a conversion this big. It will need a ton of human intervention. And for brand narrative reasons, Anthropic won't commit to such a path.

Re: Zig: Build System Reworked

#69

Earlier quoted context omitted.

> But nothing gets in your face how to use the programming language "correctly". It doesnt let you have unused variables and theres no multiline comment support. These are fairly significant productivity issues for me

What do you like to ise those features for?

In rust, having unused variables as a warning (but not an error) let's you refactor code, test it and see what is now unused as a result. You can then remove the unused items. Zig requires you to remove the unused items (e.g. with '_ = ...;' which is then something you might forget about) before testing, increasing friction.

Multiline comments are less important, but its still convenient for commenting out large chunks of code. IDEs make this a bit easier when you can press e.g. Ctrl+/ to comment out the selected lines with //, but it doesn't work in all cases.

The friction stops zig from being fun imo. A shame because I really like comptime.

Re: Zig: Build System Reworked

#70

Earlier quoted context omitted.

Just plain incorrect.. please stop spouting this nonsense, this is not the reason whatsoever.

What is the reason?

I am not aure either, but bun wasn't using normal zig and there was drama about upstreaming. Combine that with anthropics desire to show they can help rewrite everything in rust and that probably accounts for some of it.
Post reply on HN