1. 27

    I disagree with the negative posts. Writing about something you’ve just learned is absolutely a wonderful way to cement the knowledge, record it as you understand it for posterity if only for yourself, and help you pull others up right behind you. It’s not your responsibility to keep your ideas to yourself until some magic day where you reach enlightenment and only then can convey blessed knowledge on the huddled masses, a lot of this stuff (the specific tech, for the most part) moves too damn fast for that anyway. Maybe we need better mechanisms for surfacing the best information, sure, but discouraging people (yes, even noobs) from sharing what they’ve learned only ensures we’ll have fewer people practiced in how to do it effectively in the future.

    That said, I do 1000% agree that people writing in public should be as up front as possible about where they are coming from and where they are at. I definitely get annoyed with low quality information that also carries an authoritative tone.

    1. 8

      There’s a world between documenting how you learned a thing, and writing a tutorial for that same thing. If you’re learning a thing, probably don’t write a tutorial. I agree with you, writing about a freshly learned lesson helps in making the learning more permanent, though.

      1. 5

        In the case of projects, I’d rather see people committing documentation changes back to the project, at least here the creator of the project can review it.

        It’s a free internet and nobody can stop someone from doing this, but, IMO, the problem with technology is not that there is too little poorly written tutorial out there. Maybe it’s worth finding other ways of being constructive.

        1. 4

          Writing it down can help the mind remember or think on things. If errors are likely, then maybe they just don’t publish it. They get the benefits of writing it down without the potential downsides.

        1. 2

          One question I had about Zig that I can’t seem to find an answer to in an admittedly cursory look is what does it have for multithreading / parallel processing? I won’t look at a new language that doesn’t have thread support builtin.

          1. 5

            this is in process, see https://github.com/ziglang/zig/issues/174 for an overview and links to relevant issues.

            Coroutines have already landed on master: https://github.com/ziglang/zig/issues/727

            1. 2

              I won’t look at a new language that doesn’t have thread support builtin.

              Funnily enough, I’d say that I wouldn’t get excited at a new language that does have thread support builtin.

              My reasoning is that the operating system should be enough for scheduling.

              Now, I know I’m probably biased by my work on Jehanne’s kernel and the Plan 9 style, so I’m sincerely curious about your opinion.

              Why do you want more schedulers to integrate instead of using just the OS one?

              1. 1

                Threads are OS-scheduled too; they’re a kernel-provided parallelism API on both POSIXey systems and Windows. Maybe you’re thinking of green threads or threadlets or whatever?

                1. 1

                  Maybe you’re thinking of green threads…

                  I thought @jdarnold was talking about green threads, coroutines, and other similar techniques that are usually provided by language specific virtual machines.

                  Pthreads are not language specific: they are a C api that any language could wrap, but not something that requires particular support from the language.

                2. 1

                  Because threads are necessary for modern programming. If you want to take advantage of processor and OS level threading, how can you do it if the language doesn’t have some way of taking advantage of it? I’ve spent far too much time trying to figure out all the various ugly threading problems in other languages and I think the language should “just do it” for me.

              1. 13

                This post was fantastic! Super well written and super interesting. I really liked the strategy of showing the same code over and over again with minute changes.

                1. 7

                  Thanks! I worry about that being too repetitive, but I do really prefer it when the steps are shown methodically and not elided… it’s just too easy to skip the wrong thing, thinking “oh everyone knows that bit” but maybe some people don’t and suddenly you’ve lost a chunk of people.

                  1. 6

                    It’s great. It’s like watching a video of someone coding, but with advantages of a text medium.

                    I also never thought of a Brainfuck interpreter as a good Hello World type of a project. It’s actually quite a practical example - memory initialization, strings, basic io, parsing, error handling. Now that I think about it, I would like to explore the same for Rust, Pony and some Lisp variants.

                    1. 3

                      It was a great writeup. Brainfuck is only drawback given it’s intentionally designed to give folks a headache. I used to recommend folks do these examples on p-code or Forth for easier to follow interpreter or just more useful. Be interesting to see p-code or Forth done like this Zig write-up in Zig itself or another language.

                1. 3

                  Has anyone done a comparison of Zig to Rust? I use Rust a lot, and it looks like they’re targeting similar problems. Zig seems to be focused on being a direct replacement for C, while Rust seems to be more broad but still trying to stay at the systems level (replacement for C++, maybe?). I’d like to see the comparison of features that Rust has versus what Zig has (or wants to have). Oh, and how Nim fits in to this ecosystem, too!

                  Zig is an interesting project, IMO. I’m interested to see what direction it takes compared to Nim and Rust.

                  1. 3

                    I think the “Rust is to C++ as Zig is to C” analogy is broadly accurate.

                    imo, Rust and Zig are not really in direct competition- Zig places an emphasis on C interoperability and being consistent, small, and portable… Rust on correctness and compile time verifiable memory safety.

                    It seems to me like Rust’s Big Idea is the borrow checker, and Zig’s is comptime, but I realize this is likely an oversimplification on both counts.

                    I don’t know enough about Nim to comment on it.

                  1. 3

                    Andy did a twitch stream this afternoon about Zig’s compiler if anyone’s interested:

                    https://www.twitch.tv/videos/228029887

                    1. 4

                      happy to see your words!

                      1. 1

                        We tend to look down on posting commercial projects here, especially if it’s your only engagement with the site.

                        This sounds somewhat similar to pact.io (foss, self-hosted).

                        1. 2

                          This is not my only engagement with the site, and in any case I think this is a neat project despite there being a way to pay for it. But noted! I didn’t mean for it to seem like a commercial.

                        1. 3

                          Actually, a 3:5 polyrhythm isn’t typically a jazz rhythm. I mean, listen to this. That’s not jazz.

                          1. 1

                            hahahahahaha awesome I love this

                          1. 7

                            Interesting post, thanks.I think the Jazz Standard concept is useful to programming but that may just be because I play the trumpet. I don’t agree that Fizzbuzz is a standard, though.

                            The value of standards comes from establishing enough rules & structure that others can productively work with you towards a common goal. So I would say the closest analogy to programming is that a standard is a type signature. A type is an approximation of a program and likewise the chord changes of the song are its type signature. Types allow constraining inputs of functions and provide guarantees such as memory safety, and chord changes constrain the set of notes playable and provide guarantees such as song won’t be overly dissonant.

                            If you see it like I do, calling Fizzbuzz a standard is a category error. I would classify Fizzbuzz as a meme. When my friends talk about getting Fizzbuzz at an interview we laugh about it. Fizzbuzz is in Fizzbuzz Standard Edition because its funnier like that. A team of programmers isn’t gonna get together and say “alright lets riff on Fizzbuzz” unless its followed by “haha nah, but seriously”. However, they might start by establishing what interfaces they want their parts to satisfy so they can collaborate without stepping on each others toes.

                            1. 2

                              Interesting distinction! I would like to respond; I am going to think on that for a while. Thanks for reading!

                            1. 1

                              I’ve never understood where the colors come from in traditional trippy-fractal renderings, this is great. It doesn’t work in Safari or Mobile Safari though, probably because he used **2 to square numbers.

                              1. 2

                                Oooooh, I thought I had already fixed that particular problem

                                I will test it on Safari more when I spruce it up for part two maybe though.

                                Yeah! The color generation is so interesting, I was most curious about that too.