Readit News logoReadit News
rob74 · 4 months ago
The Zig Discord is a great resource for anyone learning Zig. At any given time, the zig-help forum is awash with questions from beginners like “How do you make for loop in reverse? or “What allocator to use in WASM?” Most get answered within minutes.

Am I the only one who feels this is a step back from platforms such as Stack Overflow? Discord is basically just a chat platform, and while it's nice that there are always people there who are willing to answer the same questions over and over again, you can't rely on that staying the same in the future. Whereas SO crowdsourced a "canonical" answer to a question, and if someone came up with the same question later (and didn't find the existing answer via the search function or Google), they could be pointed to that answer.

bmacho · 4 months ago
> Am I the only one who feels this is a step back from platforms such as Stack Overflow?

I have a long-held belief that the single best community information database format is Stack Overflow. (As opposed to wiki, chats, user groups/mailing lists, flat/threaded forums.) An editable top-level question, answered by several editable top level answers with different weighting on different things. (And then chat or small comments, there should be a place for some busywork that should carry no relevant information ideally.) Not necessary the website, but the format.

The second is blogosphere, allow users to write articles and engage in comments. For some reason basically no communities have these. They tend to have discord, and maybe a wiki.

zamalek · 4 months ago
I previously worked at a fintech and they, understandably so given the domain, blocked Discord. Think for a second what wonders that does for participating in open source (which the same employer had no problem with).

Discord is not a suitable platform for developers. I think Matrix is pretty good but, fuck it, I'll take IRC over Discord - it's still perfectly functional.

sebtron · 4 months ago
I agree, Discord is a terrible user experience for me. The UI is confusing and any piece of information older than a few hours disappears forever into the void.
tobyhinloopen · 4 months ago
SO is a very beginner-unfriendly platform. Every time I used it, I either did not get any replies or had my question altered, deleted, removed, closed etc. I have no clue why anyone still uses it.
Buttons840 · 4 months ago
My 10 year old question was closed as a duplicate of a 7 year old question. I'm still both bitter and amused by this. (This was a few years ago, but it's still closed.)

https://stackoverflow.com/questions/10181706/working-with-a-...

rkangel · 4 months ago
Yes, this is an unfortunate direction that SO took in the last 5 or so years. In the first 5-10 years of its life it was much more welcoming and a great resource. Now it feels like a static database of (potentially slightly out of date) FAQs.
robertlagrant · 4 months ago
The two options are: 1) no one has had their questions answered on stack overflow, or 2) your questions were duplicates or needed a lot of rewording to make them useful to people in the future.
QuadmasterXLII · 4 months ago
Asking a question on stackoverflow that is long term useful to the community isn’t a beginner-difficulty task.
Night_Thastus · 4 months ago
It's very hostile. Sometimes I just want to ask a broader, conceptual question. I don't need someone to produce working code. Just discuss.

Sometimes I can't make a working minimal example because I work with info that can't be placed online and writing something ground up that is similar enough and decoupled from the hundreds of files and hundreds of thousands of lines would take me a week or two and may not end up even working out.

Deleted Comment

emrah · 4 months ago
Not that it matters as much any more since SO is slowly dying, they should replace human moderates with AI and involve humans only when AI says it needs help with something
karel-3d · 4 months ago
You can still ask your Zig question on Stack Overflow, or they have a semi-official Discourse forum Ziggit (which I find preferable to Discord) where I got answers quickly...

Zig Discord is also just semi-official... there is also Slack, there is also mailing list, libera IRC, Telegram, QQ, Zulip...

https://github.com/ziglang/zig/wiki/Community

koakuma-chan · 4 months ago
> Zig Discord is also just semi-official

Is the Zig creator not there? I'm pretty sure he is.

charlie-83 · 4 months ago
I always found SO really slow. Often I would get stuck on something, ask a question and then have to wait an hour for a response (which would often become a back and forth of comments with large periods of time between them). Even on discords for less popular languages/libraries you generally get an answer in minutes.

I think this is likely due to the incentives SO creates. I have never actually answered a SO question because it feels like you need to answer perfectly or get torn apart. I will often contribute to a discord question even if I don't full know the answer just because I think I can add something useful.

lelanthran · 4 months ago
> Even on discords for less popular languages/libraries you generally get an answer in minutes.

On SO, at its peak, you got an answer even faster because it was public (i.e. the answer was already there, you just searched for your question).

So you're comparing minutes to instant.

Lyngbakr · 4 months ago

    > I have never actually answered a SO question because it feels like you need to answer perfectly or get torn apart. 
IME, this is heavily dependent on the language and, therefore, the subcommunity. For example, for Clojure and R I've found the SO communities to typically be kind and positive, whereas I've found the JS folks there to be dismissive and aggressive, but YMMV.

Dead Comment

dragonelite · 4 months ago
I agree i rather see all this discussion etc take place on dedicated forums or other text based options so search engines can index the stuff..
bsder · 4 months ago
Ziggit is a Zig Discourse that is pretty good: https://ziggit.dev/

It's almost as fast as the Discord and much friendlier to searching and context.

I make a point of avoiding the Discord simply because I want my questions and answers to be searchable by people who come afterward.

cassepipe · 4 months ago
Except discourse is just a forum and thus less useful than the SO format where good answers bubble up
kristoff_it · 4 months ago
Ziggit is indeed another active community and it's perfectly legitimate to want to stick to a platform vs another for personal preference, the people who downvoted this comment should really re-evaluate the way the approach this subject.
gyomu · 4 months ago
Agreed - humans like participating in chats better (when you have a problem, you want live humans ready to answer you now), but the SO style archive is better for long term archiving & retrievability.

A LLM product that turns Discord transcripts into a browsable Q&A archive would be neat.

Klonoar · 4 months ago
There are already several projects that have tried the “expose Discord data for indexing” model. Problem is no chat servers ever actually use them, perhaps because they’re at odds with expectations of people in the servers themselves.
Zambyte · 4 months ago
In the context of Zig, Ziggit has been pretty nice also. I use that instead.
kristoff_it · 4 months ago
Discord is just one of many places where you can get help from other Zig community members.

Over time I've seen plenty of comments like this one about platform A vs platform B and I find them all absolutely uninteresting. Having an active Discord server doesn't stop you from having active communities elsewhere.

Some people prefer Discord and they made a comfortable home for themselves. If you prefer a different platform (which could be a matter of personal preference or an objective advantage, it really doesn't matter which it is), then go make yourself a comfortable home there and start offering help to others on it.

If you're a newcomer and can't really offer much help, then you're asking for people who do have that knowledge to help you on a platform of your choice. That's certainly something you can wish for, but you can't demand it, regardless of how much objectively better your platform might be.

thunky · 4 months ago
> Having an active Discord server doesn't stop you from having active communities elsewhere.

It actually does when users are pointed to discord to ask the same questions over and over.

Look at the two example questions in OP's quote. Sending users to discord for those means nearly nobody else will benefit from the answers.

And I think it's fair to point this out.

rembicilious · 4 months ago
I don’t really think chat is a step back (discord may be a step back vs irc or I am just graying). Learning newish tech in chat has always been way more engaging for me than wiki or forum style communication.

IME chat attracts people who devote a lot of energy to the topic, including top contributors and power users. If you have questions about the latest features or obscure use cases there isn’t a better place to go.

Forum and wiki are great formats too, with different strengths. But if you are frustrated because you can’t seem to find help in those formats, head for the chat.

Some communities archive their chat. This seems like a great source of data to bootstrap a wiki or faq.

troupo · 4 months ago
> forum is awash with questions from beginners like “How do you make for loop in reverse? or “What allocator to use in WASM?” Most get answered within minutes.

You wouldn't get a chat awash with these questions if they could be easily searched for.

interpol_p · 4 months ago
Totally agree

But once we opened a Discord for our product we had so many more questions and users coming in. I do not like that it is locked up on a proprietary platform organised as a chat interface, but damn is it popular and often-used. Having users communicate with us more regularly is very motivating, and we've had so much more quality feedback by having it available

It is, unfortunately, where a lot of the people are and it makes your user base feel very "alive"

jjani · 4 months ago
Why not use AnswerOverflow to make the chats indexed and searchable? It's definitely a lot better than nothing, multiple times it has already helped me find answers to questions I had.
TUSF · 4 months ago
I don't think SO's "canonical answer" concept really jives with a pre-1.0 language like Zig that is still in constant flux, regularly making breaking changes. One of the questions the blog brings up as an example, "What allocator to use in WASM?" would have a different answer last year than it would this year, and may well have a different answer next year.
rkangel · 4 months ago
I agree, but I think that you could get a useful middle ground by continuously publishing the contents of your Q&A Discord channel to the internet (in a way where it gets indexed by search engines).

Yes, Stack Overflow collated these questions and answers better but then at least you could google for something and get the answer, rather than asking again.

Buttons840 · 4 months ago
Discord is really bad if you want more than 1-on-1 real-time communication with other humans. This is also its primary advantage.
krapp · 4 months ago
In a world where every surface of the web is infested with bots, trolls, spammers and AI slop, persistent static and public information is a hazard. Moving knowledge to ephemeral communities is an immune response to what the web has become. I'm usually not a fan of gatekeeping but doing so to filter for human beings seems like a necessary evil.
drob518 · 4 months ago
Discord sucks. Slack is so much better, IMO.
IshKebab · 4 months ago
I tried Zig a bit and found it quite nice, but it is very low level. Like in Rust you concatenate strings like this:

  let result = format!("{a}{b}{c}");
In Zig it's something like this:

  const allocator = std.heap.page_allocator;
  const parts = [_][]const u8{"a", "b"};
  const result = std.mem.concat(allocator, &parts[0], 2) catch @panic("allocation failure");
  defer allocator.free(result);
I dunno if I want to write any really significant programs like that. At least not any that use strings a lot!

MawKKe · 4 months ago
There's also `std.fmt.allocPrint()` which functions similarly to `format!()`. Although I'd argue its rather poorly named, like many of the functions in the stdlib...

For wanting to avoid fiddling with multiple repeated alloc/defer-free, it's often convenient to use the arena allocators that allow you to release everything with a single `defer arena.deinit()`

unwind · 4 months ago
I would (coming from a C background) guess that `allocPrint()` owes its name from the C standard library function(s) `as(n)printf()`[1]. At least that would make sense, the naming is modernized by being made longer, to gain clarity.

[1]: https://man7.org/linux/man-pages/man3/asprintf.3.html

bgthompson · 4 months ago
My game has a bunch of strings, and my string code currently looks very different to this! For example, copying two lines from source:

  var buffer : [64] u8 = undefined;
  const level_name_cstring : stringnt = std.fmt.bufPrintZ(&buffer, "{}. {s}", .{icon_index + 1, level_name}) catch unreachable;
(Make the string "10. Fortress" from the int 10 and "Fortress")

The reason is, most of the strings in my game are bounded, and actually, known ahead of time. None of the levels have names that approach anything as long as 64 bytes, so I can actually do a fair bit of string manipulation on the stack before needing to use / save it to an allocator. (At least for now before localization XD)

So it depends on the use case. Sure, string manipulation in general can be tiresome in Zig, but in many cases it's also simple.

IshKebab · 4 months ago
Isn't `unreachable` in Zig like in C? So very bad things can happen if you overflow.

This sort of code makes me nervous about Zig.

belst · 4 months ago
Discord (Chat in general) is really nice if you are the first to have a problem.

If anyone else has the same problem, they can't find it by just googling tho. So they need to ask the same question again which gets annoying pretty fast unfortunately

Zambyte · 4 months ago
Not sure why this was flagged. It was an interesting read, thanks for sharing. My biggest concern with using Zig has been the breaking changes that you mentioned, but I have been pushing forward with it for personal projects because it just seems like people are able to work around them easily, like you mentioned.
bgthompson · 4 months ago
You're welcome! My experience with the breaking changes in Zig has not been bad at all. For brevity in the blog I didn't get into what I had to do to get things working again, but the process itself was straightforwards. Sometimes the names of some standard library functions had changed, sometimes it was some extra fields in the build system. Whatever the case, the changes were almost always documented in the release notes anyway, so after reading the release notes I basically knew the (small) amount of work I had ahead of me.
thunkingdeep · 4 months ago
All posts not fellating Rust are eventually flagged here. It’s not really a neutral venue for more academic conversations about PLT.
jvanderbot · 4 months ago
First class SIMD vector support is awesome. The complaint about that not being first class matrix support kind of misses the mark: it's all vectors all the way down.

This is one glaring omission from Rust. Their SIMD integration is library specific and patchwork but improving.

lerno · 4 months ago
Out of C3, Odin and Zig, Zig is actually the language with the worst SIMD support. Odin has SIMD vectors, array programming and built in matrix types while C3 has built in SIMD vector types and operator overloading for userland numerical types such as matrix and complex types.

Odin and C3 has things like swizzling, assigning a scalar to all elements etc out of the box, whereas Zig is similar to C and just provides compiler builtins. Compare `vec * @splat(foo())` (Zig) to `vec * foo()` (Odin/C3).

johnisgood · 3 months ago
Yeah I dislike Zig for all those "@()" stuff.
jamiejquinn · 4 months ago
Snap! I've been developing a roguelike in zig for nearly exactly a year and my experience is very similar. I especially appreciate your mentioning the positives that come with breaking changes.

Seems like you're also a C/C++ developer so I'm curious: how have you found zig's comptime compares to templates? (Personally I've found it a refreshingly simple experience, if occasionally annoying due to pre-1.0 bugs)

bgthompson · 4 months ago
For my (relatively simple) use cases, I've had a significantly better time using comptime than templates; the syntax and the quality of the error messages are a lot simpler in Zig. While I've never attempted to do anything super fancy with templates in C/C++, my gut feeling is that comptime can provide most, if not all, of functionality that templates provide. (But C/C++ template experts please chime in if this is not the case.)
jvanderbot · 4 months ago
Former Cpp dev here. If I never have to debug a template barf it'll be too soon. By the end of my time in C/Cpp land I'd written more C than anything, with occasional "structs with con/de-structors". Happily the next gen of systems languages fit about in that niche already!
sgt · 4 months ago
Zig is really HN's new love story, isn't it. Or quickly becoming...

Rust is still popular but it turns out the developer joy is pretty low.

WD-42 · 4 months ago
I’ve been dabbling in OS development. I started with rust and it was… ok. Lots of what you’d expect: unsafe all over the place, weird borrow checker work arounds. It felt like I was bending the languages arm.

I recently started to re implement the (admittedly very basic) kernel in Zig and it’s been a breath of fresh air. The language seems much better suited for the level of abstraction that Osdev lives at. Major bonus is that all the existing C code is directly useable in a zig project without any wrapper nonsense or it can be easily translated.

I think I’ll stick with dig for a bit.

Majora320 · 4 months ago
I think base Rust is a great language, but the ecosystem tends towards very complex and overengineered solutions; with advanced uses/abuses of macros and the type system, trait hell ends up being not too dissimilar to template hell from C++. And the async/await story is plagued with layers and layers of complexity due to the many obtuse interactions with its lifetime system. Rust honestly probably should've gone with its original idea of green threads/channels, like GC-less Go, but that idea was dropped a long time ago.
Buttons840 · 4 months ago
"Joy" is always highest for new languages, because there are only green fields and enthusiasts. "Joy" is also increased by languages that let you just do what you want, like dynamic typing, or other language features that delay seeing that first error.
pcwalton · 4 months ago
This is a good point. Zig is practically optimized for this: comptime is extremely dynamically typed compared to actual generics, and the lack of memory safety is often "a breath of fresh air"--until you have to actually fix bugs (including security bugs) resulting from it.
ultimaweapon · 4 months ago
> Rust is still popular but it turns out the developer joy is pretty low.

Rust is one of the language I enjoy to use. The problem is you need to overcome its steep learning curve in order to enjoy it, which people tend to give up because it is too hard.

christophilus · 4 months ago
For me, it wasn’t the learning curve that was the problem with Rust. It’s the compilation time. It’s just so slow. I’m used to OCaml, Go, and Typescript (via Bun or esbuild) with iteration times in the tens-to-low-hundreds of milliseconds. Zig still feels a wee bit slow, but it’s acceptable. Rust? It makes me want to toss my laptop into the fire.

To be honest, I haven’t touched Rust in years, so it may have improved.

jvanderbot · 4 months ago
Which to me is fine. It's not a great hobby language but it is a fantastic professional language, precisely because of the ease of refactors and speed of development that comes with the type system and borrow checker.
Klonoar · 4 months ago
If you’re only looking at HN, sure.

The programming world is much larger than this small slice of the internet, though. HN has had several eras of “this is the hot new fad language and you should use it!”, going as far back as Lisp in the mid-2000s.

It will likely continue to experience this cycle until the heat death of the universe.

pcwalton · 4 months ago
> Rust is still popular but it turns out the developer joy is pretty low.

I mean, Rust keeps winning the "most loved" language contest on GitHub, so it seems someone likes it.

Bolwin · 4 months ago
I think you're talking about stackoverflow not github
rc00 · 4 months ago
IshKebab · 4 months ago
> After compiling the game with the flag -Dcpu=baseline, the binary contained only x86-64-v1 instructions, allowing my friend to play the game.

Feels like the startup code should actually verify that it's running on a suitable CPU rather than just crashing.

I don't think C/C++ or Rust do this either but they should!

tuetuopay · 4 months ago
pretty much no language do this by default. however, most languages target the -v1 instruction set in 'release' or optimized mode. (e.g. Rust does this, and AFAIK GCC and clang both do this for C/C++)