Live data from Hacker News

Zig, the Small Language

zserge.com

11–20 of 429 posts

Re: Zig, the Small Language

#11
post #9
post #5

Earlier quoted context omitted.

You can always do ' _ = your_varible', don't have to comment individuals

That makes unused variables "used", which defeats the point of the check.

Yep. Exactly. We want to be able to silence the compiler for a few iterations while the code is taking shape and then cleanup all the compiler lints in later iteration. In production CI pipeline, we can have all compiler lints on. This capability is very much needed to have a fast local dev iteration where compiler can assist but not impede.

Re: Zig, the Small Language

#12

I tried Zig recently but I found the unsilenceable lints to be a huge productivity killer. I actually posted a link to the GitHub issue this morning. https://news.ycombinator.com/item?id=32751317 This makes a normal workflow with `watchexec zig test` basically impossible, since before I can even run the tests I have to spend time hunting down which variables are used/unused at the moment and (un)commenting them. And…

100% agree, do not understand the resistance to adding a flag or other way to temporarily disable that.

Re: Zig, the Small Language

#13
post #5

Earlier quoted context omitted.

You can always do ' _ = your_varible', don't have to comment individuals

That was the first suggestion that Kelley posted on the issue and judging by the reactions people weren’t happy with it.

His suggestion is even counterproductive in a way, because it makes it more likely people will accidentally commit unused vars they have silenced. I _want_ the compiler to help me find unused things... just not yet. Wait until my pre-commit hook to yell at me please!

Re: Zig, the Small Language

#14
post #7

Zig indeed is pretty nice, i just wish it had some more sweet to it - my math type with + - * / overloads - simpler way to fill an array, i can never remember the syntax, it doesn't feel natural `[_]u8{0} * 10;` - smarter type system, i am tired of casting everything twice A good language is not a language set in stone, a good language is a language that doesn't make me feel like i have to suffer because they made a…

"In the beginning the [operator overloading] was created. This has made a lot of people very angry and been widely regarded as a bad move."

But in all seriousness that's pretty much antithetical to zig's goals regarding explicitness.

Re: Zig, the Small Language

#15

Earlier quoted context omitted.

That was the first suggestion that Kelley posted on the issue and judging by the reactions people weren’t happy with it.

His suggestion is even counterproductive in a way, because it makes it more likely people will accidentally commit unused vars they have silenced. I _want_ the compiler to help me find unused things... just not yet. Wait until my pre-commit hook to yell at me please!

I've definitely done this, and this is a good argument for changing the behavior.

Re: Zig, the Small Language

#16
why do people care about binary size? I have never understood this. Disk space isn't free but the size of the binaries on my machine doesn't seem like a big problem to me in that regard.

Re: Zig, the Small Language

#17
post #7

Zig indeed is pretty nice, i just wish it had some more sweet to it - my math type with + - * / overloads - simpler way to fill an array, i can never remember the syntax, it doesn't feel natural `[_]u8{0} * 10;` - smarter type system, i am tired of casting everything twice A good language is not a language set in stone, a good language is a language that doesn't make me feel like i have to suffer because they made a…

"In the beginning the [operator overloading] was created. This has made a lot of people very angry and been widely regarded as a bad move." But in all seriousness that's pretty much antithetical to zig's goals regarding explicitness.

if we can do 1 + 1, we should be able to do vec2 + vec2, same with mat4 * mat4

Odin proved it that it can be made efficiently while keeping sanity

Re: Zig, the Small Language

#19
post #6

why should I use Zig coming from Python/Go ?

Realistically, you probably shouldn't. Zig seems to be positioning itself as a systems-level language—more of an alternative to C/C++/Rust than to Python/Go. If you're building low-level, high-performance software, it might be interesting to you; otherwise, I don't see a practical benefit.

Re: Zig, the Small Language

#20

I maybe overstating it, but another contributing factor to its growing popularity may be the documentation. It is really nice and well presented. Reminds me of how the rust book also welcomed you to explore the language.

Zig has good docs now? Nice. Last I looked Zig had some of the worst docs I'd seen to the point where I just looked at the std sources and eventually just gave up

Maybe language docs vs stdlib docs. Language docs are good for most topics, stdlib docs are much worse than stdlib sources.
Post reply on HN