Live data from Hacker News

Zig: Build System Reworked

ziglang.org

31–40 of 263 posts

Re: Zig: Build System Reworked

#31

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.

Low-level programming gets a bad name because C has many footguns and the spec leaves much behavior undefined - a fact that implementers use almost adversarially (which I'd support, if the goal was to refine the spec...). C++ adds more high-level conveniences without actually removing the footguns and undefined behavior (much C code compiles in a C++ compiler). Zig tries to keep the low-level C philosophy but have th…

Basically what the world has lost by ignoring Modula-2 and Object Pascal, and going down the C path.

Re: Zig: Build System Reworked

#33
post #29

Earlier quoted context omitted.

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.

Not to mention that where heavy computation is required, Python often has libraries that are much, much faster than anything you can quickly hack together in C or Zig.

As long as you can express everything you need on the library's terms. As soon as you write a Python loop, your performance plummets.

Re: Zig: Build System Reworked

#34
post #17
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.

It’s definitely a great tinkering language but .. eh .. the Zig team and community are extremely opinionated about how to use the language correctly.

This has not been my experience.

Re: Zig: Build System Reworked

#35

So i checked the license of this project, can anyone pls clarify what is (Expat) after MIT License

There are a number of licenses that are named MIT that are all similar, but not identical.

The "Expat" here is the MIT license variant. It is referring to the Expat XML parsing library that first used this license.

Usually when projects these days use an MIT license this is the version they use.

Re: Zig: Build System Reworked

#37

So i checked the license of this project, can anyone pls clarify what is (Expat) after MIT License

There are different licenses that used to be referred to as "MIT", and explicitly stating "Expat" tells you which one they're referring to (in this case, the "standard" one). This is largely unnecessary, as nearly all mentions of the MIT license refer to this one.

Re: Zig: Build System Reworked

#38

Earlier quoted context omitted.

Zig is low level, so it will certainly not replace your python usage, it is more like a modern C than anything else. There’s a video of a recent interview with Andrew Kelley, if you want to watch it to understand better what Zig is for, it’s on Jetbrains YouTube channel.

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.

[deleted]

Re: Zig: Build System Reworked

#39
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.

Is it really that good? My go-to "tinker in my garage" language is Python - lightweight syntax that stays out of your face, batteries included, packages for everything that's not included. What's Zig's edge?

And not only that, if you're doing something in Python, somebody has done it before. Maybe not this exact thing, but something close enough to it. LLMs know it, Stackoverflow knows it, whatever esoteric protocol or file format you're trying to interact with, somebody wrote a library for it in the Python 2 days and has ironed out all the bugs since.

There's no other language quite like Python in this regard. Typescript is a close second, but the lack of metaprogramming facilities, no access to the type annotations at runtime, and the lack of operator overloading make some things needlessly complicated and uglier than they have any right to be.

Re: Zig: Build System Reworked

#40
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.

And if you really need more performance (or, more often, fast startup times), Go gives you 90% of the speed with 30% of the effort. Rust if you really want to squeeze everything that can possibly be squeezed of that CPU.
Post reply on HN