Live data from Hacker News

Zig by Example

github.com

91–100 of 109 posts

Re: Zig by Example

#91
post #83

Earlier quoted context omitted.

You can just read a paragraph or two of each email, and then decide whether or not to delete them. We don't additional tools to combat spam.

Kind of feels like a slightly different thing, I don't spend days/weeks reading through one email.

we don't pay for emails either

i think for consumer protection, AI products need to be flagged as AI products, clearly labelled as AI produced or assisted , of course for free goods the burden is on us, but for anything we pay for, I hope we get this protection

Re: Zig by Example

#93
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'm suspicious that the user base is people who like to program using pointers in business logic. So, the subset of current C programmers who are willing to switch. With this in mind: Does anyone here program in Zig, or know someone who does who is not a current C (or C++) programmer?

I'm professionally a python programmer with no C/C++ experience, and I do some hobby programming in zig. I tried rust but it seemed complicated and kind of boring. Zig was a lot easier for me to get into. I don't mind that it's obscure and a bit of a moving target, but I have yet to do anything really "serious" with it.

Re: Zig by Example

#94
post #83

Earlier quoted context omitted.

You can just read a paragraph or two of each email, and then decide whether or not to delete them. We don't additional tools to combat spam.

Kind of feels like a slightly different thing, I don't spend days/weeks reading through one email.

If someone wanted an AI generated Zig tutorial, why wouldn't they go to their favorite LLM supplier and simply prompt the AI for one? Why do we need someone to create this spam ahead of time? LLMs are improving all the time and Zig is a moving target. Seems like a win-win-win. The end-user gets a better (and potentially customized) tutorial for the latest Zig, and there is less overall spam pollution.

Re: Zig by Example

#95

Earlier quoted context omitted.

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…

I think if you need to get so close to the bare metal that you'd need unsafe Rust then the equivalent Zig is also too dangerous to use "infrequently". Stuff like writing raw assembly, pointer twiddling, volatile stores or fetches - I would hire somebody with lots more experience to do that properly once if you need it. On the other hand if safe Rust is an option that's way more handholding than you're getting in Zig.…

For clarity in this dual programming language scenario I'm talking about, I'm writing a user facing app that's mostly a lot of business logic.

It's running slow so I profile it and I see my math function in pure Dart (or whatever language you are writing in) is the hot spot, and pressures the garbage collector too much, so I rewrite the function in a lower level language that doesn't have as much overhead, to speed things up. Then I just call it from the higher level language through the FFI.

The benefit of Zig is the syntax is simple, and the build steps are simple, so it doesn't slow down app development too much

Re: Zig by Example

#96
post #94

Earlier quoted context omitted.

Kind of feels like a slightly different thing, I don't spend days/weeks reading through one email.

If someone wanted an AI generated Zig tutorial, why wouldn't they go to their favorite LLM supplier and simply prompt the AI for one? Why do we need someone to create this spam ahead of time? LLMs are improving all the time and Zig is a moving target. Seems like a win-win-win. The end-user gets a better (and potentially customized) tutorial for the latest Zig, and there is less overall spam pollution.

I don't have the answers to those questions, and I don't know why I'm being asked those either. I don't like AI-slop either, I don't think anyone except the ones who produce it themselves like it.

But ultimately it's a fools errand trying to stop/get people to do something, best you can do is adjust your own approach.

Re: Zig by Example

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

I think this is a major problem with Zig in that they've cornered themselves into not utilizing AI and have attracted anti-AI absolutist crowd that is going to be a major hinderance. As a Rust user, AI has put Rust easily in the hands of developers who were previously intimidated by it. I've learned a ton about Rust simply by fiddling with LLMs and asking questions to other Rust devs who don't really care whether AI…

You are free to use AI to write Zig code just not use AI to write code for Zig. In fact, many people already do build software with zig written by AI. Check out rockorager's github.

Re: Zig by Example

#98
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

That guy’s entire post and submission history appears to be listicles and slop.

Re: Zig by Example

#99
post #42

Earlier quoted context omitted.

If you want to learn systems programming, I can recommend learning C. If you want to learn a programming language which allows systems programming, I guess Rust is not a bad choice. But it might be less helpful if the systems basics are unknown.

I'm an industrial equipment programmer, so I do see C quite often. Actually, aside from C, it's just that when I first learned programming in college, I started with C. I thought that was only natural, but I guess I didn't explain enough. Inside my own head, C just feels like a given.

If you know C well already, there is nowhere to go deeper systems-wise, apart from assembly. Maybe you mean higher as in more abstract? Rust is pretty abstract compared to C. Zig not so much by design. If you want to try something else entirely paradigm-wise, maybe something like Haskell could be interesting to you, or if type systems interest you, TypeScript's is quite sophisticated.

Re: Zig by Example

#100
post #79

Earlier quoted context omitted.

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 refer…

I have never understood this way of approaching programming. I feel the best way to learn a language is solving a problem you have in that language.

Figure out an actual real problem you have which you can solve with programming and just implement it in a language you're thinking about learning. This way there's nothing to invest in because you're solving a problem instead of approaching programming as if it was some coursework. It is not.

Post reply on HN