Live data from Hacker News

Zig by Example

github.com

71–80 of 109 posts

Re: Zig by Example

#71
post #21

Is Zig just a trend, or will it become a solidly established language? After all, learning something is an investment of time. With Zig, it doesn't seem to have the same kind of industry pressure as Rust. There's talk in open source circles about AI-related issues, and on Hacker News people say good things about Zig. The allocator concept looks great. But there's also a possibility that it won't become mainstream, li…

It's unsafe and intentionally crashes on windows newlines and tabs. If C adopts defer, I don't think there will be enough of a differentiation to overcome the cynical user hostility. Just because people don't like this doesn't mean it's not true.

> C adopts defer

C will almost certainly adopt defer in the next revision standard. C++ (via RAII + scoped classes) already effectively has defer.

But the fact that it's unsafe means it's effectively unadoptable, no reason not to use C inplace of it.

Re: Zig by Example

#72
post #21

Is Zig just a trend, or will it become a solidly established language? After all, learning something is an investment of time. With Zig, it doesn't seem to have the same kind of industry pressure as Rust. There's talk in open source circles about AI-related issues, and on Hacker News people say good things about Zig. The allocator concept looks great. But there's also a possibility that it won't become mainstream, li…

Here is where I think Zig shines. When you are a high level programmer that needs to drop down to a low level programming language for performance reasons. The issue with doing that as a high level programmer is that you don't do a lot of low level work frequently. So unless you work in another domain where you do a lot of low level programming, then every time you drop down you will be out of practice. This favors u…

Looking at it from an existing knowledge base and error checking point of view, I feel like C++ smart pointers or Rust is a better option for someone doing a dangerous low level thing rarely. I'm not sure Zig is really all that favorable a choice in your given scenario.

Re: Zig by Example

#73

Earlier quoted context omitted.

Linters are not exactly a new idea, and they can be pushed quite far. I am generally against the idea of language support for meta-programming, even using C macros or C++ templates. I do a lot of meta-programming/codegen with external tooling.

> Linters are not exactly a new idea, and they can be pushed quite far. That's not an answer. There's a reason why you can't do it in C, and the reason is "the stdlib is poorly designed". No amount of linting can get you around that.

I agree about the C stdlib being outdated and the worst part of C. This is why I don't use it.

A new modern C standard library would be a very good thing. But I am ok writing my own, tailored for my own needs and style.

Re: Zig by Example

#74
post #67
post #50

This is outdated and AI generated. If you want a good source of zig learning material interactive and by examples please check out ziglings: https://codeberg.org/ziglings It's writen and tested by humans, which is essential for learning purposes. It's listed in the official zig website, by the way. This project is always up to date to the latest zig release.

well, it also made by the same guy behind the boring go book which probably means that boring go is also most likely AI generated nowadays before reading or buying any book, we need to extensively investigate the author, the author name is now more important than ever, i think whenever a book is shared, the author need to me highlighted

> nowadays before reading or buying any book, we need to extensively investigate the author

I mean not really. You read a paragraph or two and notice the quality of the text, start getting suspicious and continue two or three paragraphs more, notice some very basic inconsistencies/incoherence, realize it's AI-written and ctrl+w the tab (or put back the book in the shelf) and move on with your life.

If there is no samples of the book, I'd hesitate to even consider buying it, just so you can actually sample the text. Very easy in bookstores luckily, so not a huge problem in the end.

Re: Zig by Example

#75
post #21

Is Zig just a trend, or will it become a solidly established language? After all, learning something is an investment of time. With Zig, it doesn't seem to have the same kind of industry pressure as Rust. There's talk in open source circles about AI-related issues, and on Hacker News people say good things about Zig. The allocator concept looks great. But there's also a possibility that it won't become mainstream, li…

I’d prefer that you watch this video interview with Andrew Kelley. He is describing that.

https://www.youtube.com/watch?v=iqddnwKF8HQ

Personal thoughts: I think Zig will become more stable once 1.0 tag released. Currently I cant find a fix to my error in net. But the folks on Zig Discord server helping me out.

Re: Zig by Example

#76
post #21

Is Zig just a trend, or will it become a solidly established language? After all, learning something is an investment of time. With Zig, it doesn't seem to have the same kind of industry pressure as Rust. There's talk in open source circles about AI-related issues, and on Hacker News people say good things about Zig. The allocator concept looks great. But there's also a possibility that it won't become mainstream, li…

Why do people still view languages as an investment? If you know programming then it's just a different syntax. Focus on learning programming.

Re: Zig by Example

#79
post #21

Is Zig just a trend, or will it become a solidly established language? After all, learning something is an investment of time. With Zig, it doesn't seem to have the same kind of industry pressure as Rust. There's talk in open source circles about AI-related issues, and on Hacker News people say good things about Zig. The allocator concept looks great. But there's also a possibility that it won't become mainstream, li…

Why do people still view languages as an investment? If you know programming then it's just a different syntax. Focus on learning programming.

You're not wrong at the high level, but learning a particular language to the point of fluency is still an investment if you're interested in being productive while writing it. Sure, once you have the experience, reading most new languages is easy -- but learning the idioms and particular syntactic choices of a new language to that point that you can reach for them without having to constantly search or consult references isn't something that's instant. There's also a mental cost to how many of those languages you can have "ready to go" in your brain at any given time, and for languages that are evolving -- most of them, at this point, honestly, even old languages like C++ -- there's a cost to keeping up with the language as it changes.

All of that is investment, and not all languages pay off that investment.

Post reply on HN