Comment by hardwaresofton

Comment by hardwaresofton a day ago

23 replies

Yeah, thinking about this attitude positively, maybe it’s a feature — if only hard core people can comfortably figure it out, you get higher quality contributions?

Not trying to imply that’s an explicit goal (probably instead just a resource problem), but an observation

ksec a day ago

I think it is a trade off for between zig's development speed and documentation. It is Pre 1.0, extreme beta mode with lots of breaking changes.

Generally speaking I think it is the right trade off for now. Purely inferring from Andrew and the Zig's team online character as I don't know them in person, I think they do care a lot of DX, things like compiling speed and tools. So I think once 1.0 come I won't be surprised if it will have extremely good documentation as well.

And I would argue, writing good, simple, clear, detailed documentation is actually harder than writing code itself.

  • brabel a day ago

    I've written many APIs. Never have I got it right without first writing lots of tests, finding the rough corners, improving it... and so on. Writing documentation after that is absolutely mandatory for the end result to be a high quality API. As you write how it is meant to work, you will definitely find things that don't really make sense, or that should not be as hard ( I think this post shows just such an API that hasn't gone through this process ). IMHO documentation is NOT optional. The implementation is NOT how you mean for the API to be used.

  • hardwaresofton a day ago

    On the one hand, I totally get that pre 1.0 is the wild west (somewhat) and should be. The team is right in jealously guarding their ability to make changes.

    That said, others have pointed out that writing documentation and tests helps improve quality quite a bit, and in this case it would also increase usability. I think I'd agree with this stance, but there is no way I could make the statement that even most of the code I've written for public consumption had excellent documentation or examples. So I've got no leg to stand on there, just the armchair.

    > And I would argue, writing good, simple, clear, detailed documentation is actually harder than writing code itself.

    All the more reason why it must be done! A little silly but from my armchair maybe it's one of those "start with the interface you want and work backwards", but the problem is that approach can be at odds with mechanical sympathy and we know which side Zig lands on (and arguably should land on based on it's values).

  • LambdaComplex a day ago

    My quick skim of Wikipedia may not be telling the complete story, but it says the initial release was 9 years ago (February 2016). After nearly a decade, I would hope that things would be out of "extreme beta mode," but I guess this isn't the case?

    • ksec a day ago

      For most of its time it is simply a single person and part time project. Even to this day the team is nowhere near Rust or Go's resources.

      • tialaramex a day ago

        In 2016, nine years ago, Andrew announced he'd been working on the new language "Zig" for a couple of months.

        In 2018, seven years ago, Andrew announced he'd go full-time on Zig and quit his paying job to live off donations instead.

        In 2020, so five years ago, Zig's 501(c)3 the ZSF was announced, to create a formal structure to hire more people in addition to the few already on Zig.

        So, "most of its time" is just not true. For "most of its time" Zig was a small, largely independently funded project for multiple people, for a tiny period it was a part-time project, and for a while after that it was solo, but those weren't the majority of its existence.

        • throwawaymaths a day ago

          yeah but i think you can count on one hand how many full time zig developers are paid by the foundation.

      • LambdaComplex a day ago

        Huh, I actually expected there to be a bigger team working on it. In that case: I'm really impressed.

    • HumanOstrich a day ago

      What's the benchmark for how long something can be pre-1.0? Seems like a nonsense argument.

      • Dylan16807 a day ago

        It's the combination of pre-1.0 and having rapid development speed that is being questioned here. And it's a good question, not nonsense.

        If you keep up the development pace you're going to approach stability. Unless you're in a manic spiral of rewrites.

      • yxhuvud a day ago

        Something can be pre-1.0 as long as there are no stability guarantees.

      • pharrington a day ago

        There is no benchmark. As a species, we don't even know know what a good programming language is, let alone how to reliably develop one. This stuff takes time, and we're all learning it together.

        I like to compare this to real world cathedral building. There are some cathedrals that are literally taking centuries to build! It's OK if the important, but difficult thing takes a long time to build.

    • littlestymaar a day ago

      Same as Rust being almost a decade old when the first 1.0 was published.

      Making a programming language from scratch is a long endeavor when it's a one man project.

  • sshine a day ago

    Unstable APIs are a good example of something that's extremely valuable early on.

    They unarguably cause confusion for everyone as they change.

    But it lets you choose the right abstractions that are going to stick for decades.

    If you're going to make a python2 -> python3 transition in your language, make sure it's X0 -> X1.

chrisandchris a day ago

Contributions to the Zig language or contributions to software using Zig (the latter is the one the post is about as I understand)?

If so, I believe Zig will stay within a niche. Lower entry barriers allow "script kiddies" to easily start withe language, and they eventually will become leading engineers. Only a few people tend to go straight for the highest practice without "playing around". IMHO the reason, why PHP got so popular (it was not good back then, just very very easy to start with).

  • hardwaresofton a day ago

    > Contributions to the Zig language or contributions to software using Zig (the latter is the one the post is about as I understand)?

    Yes.

    I think a contributor that really wanted to help the ecosystem would start in the stdlib and then start moving outwards. Even if it was LLM-assisted, I think it could be high value.

    IIRC Loris already has an engine for building websites with Zig, but making sure that every Zig library has docs (similar to rustdocs) might be a great start. It is incredibly useful to have a resource like rustdocs, both the tooling and the web sites that are easily browsable.

    Again, maybe everyone in the Zig ecosystem just has amazing editor setups and massive brains, but I personally really like the ease of browsing rustdoc.

    > If so, I believe Zig will stay within a niche. Lower entry barriers allow "script kiddies" to easily start withe language, and they eventually will become leading engineers. Only a few people tend to go straight for the highest practice without "playing around". IMHO the reason, why PHP got so popular (it was not good back then, just very very easy to start with).

    I agree, but I'd add that the niche they're aiming for is systems programming, so they're probably fine :). The average hacker there is expecting C/C++ or to be near the metal, and I think Zig is a great fit there. They're likely not going to convince people who write Ruby, but it feels reasonable for C hackers.

    Also I want to just be clear that I think Zig has a lot of motivating factors! They're doing amazing things like zig cc, unbelievably easy, "can't believe it's not butter" cross-compilation, their new explicit/managed I/O mechanism, explicit allocators as a default, comptime, better type ergonomics. It's a pretty impressive language.

    • flohofwoe a day ago

      > already has an engine for building websites with Zig, but making sure that every Zig library has docs

      Tbh, this sort of auto-generated docs from source code is not all that useful, since you get that same information right in the IDE via the language server.

      The important documentation part that's currently missing is how everything is supposed to work together in the stdlib, not the 'micro-documentation' of what a single type or function does. And for this sort of information it's currently indeed better to look at example code (e.g. the stdlib's testing code).

      IMHO it's way too early for this type of high-level documentation, since things change all the time in the stdlib. Putting much work into documenting concepts that are discarded again anyway doesn't make much sense.

      • BobbyJo a day ago

        Tests very often don't tell you the right way to use something, especially when you're talking about IO libraries. Examples themselves often don't even show the "correct" way, but rather just a way that will work in ideal circumstances.

rjh29 a day ago

I think it is intentional. They don't want to attract low-commitment beginners while the language is heavily changing (and explicitly in beta). Such people will ask questions and ask for documentation but contribute nothing.

DannyBee a day ago

More likely you get people who have the same groupthink, which has both ups and downs. Their contribution quality is probably not that well correlated.