←back to thread

Open-source Zig book

(www.zigbook.net)
692 points rudedogg | 6 comments | | HN request time: 0.001s | source | bottom
Show context
poly2it ◴[] No.45951222[source]
> Learning Zig is not just about adding a language to your resume. It is about fundamentally changing how you think about software.

I'm not sure what they expect, but to me Zig looks very much like C with a modern standard lib and slightly different syntax. This isn't groundbreaking, not a thought paradigm which should be that novel to most system engineers like for example OCaml could be. Stuff like this alienates people who want a technical justification for the use of a language.

replies(10): >>45951231 #>>45951258 #>>45951302 #>>45951388 #>>45951755 #>>45951799 #>>45951814 #>>45951964 #>>45952563 #>>45952740 #
userbinator ◴[] No.45951231[source]
For those who actually want to learn languages which are "fundamentally changing how you think about software", I'd recommend the Lisp family and APL family.
replies(4): >>45951356 #>>45951479 #>>45951521 #>>45952626 #
zwnow ◴[] No.45951356[source]
I'd also throw Erlang/Elixir out there. And I really wished Elm wasn't such a trainwreck of a project...
replies(2): >>45951854 #>>45952573 #
1. 59nadir ◴[] No.45952573[source]
No need to include Elixir here; none of the important bits that will change how you view software come from Elixir, it's just a skin on top of Erlang (+ some standard library wrappers) and that's it.
replies(1): >>45952623 #
2. zwnow ◴[] No.45952623[source]
I'd argue more people use Elixir over Erlang at this point. Sure its just an abstraction on top of Erlang, but people learn through Elixir nowadays, not through Erlang.
replies(1): >>45952782 #
3. 59nadir ◴[] No.45952782[source]
If you want to learn the actual mind changing aspects of the BEAM, clearly learning the simpler, smaller language with a more direct route to the juice is the way to go. Hence Erlang, not Elixir. I learned Elixir first back in 2015, and then learned Erlang, and have had the pleasure of using both in production. When all was said and done I really think Erlang was better, especially over a long enough time frame.

As a general point I'd like to state that I don't think it really matters what "people" do when you're learning for yourself. In the grand scheme of things approximately no one uses the BEAM, but this doesn't mean that learning how to use it is somehow pointless.

replies(1): >>45956574 #
4. fuzztester ◴[] No.45956574{3}[source]
>actual mind changing aspects of the BEAM

What are those aspects?

newb to this area.

replies(1): >>45959057 #
5. 59nadir ◴[] No.45959057{4}[source]
A few key things:

- Leaning on a pre-emptive scheduler to maintain order even in the presence of ridiculous amounts of threads ("processes" on the BEAM) running

- Using supervision trees to specify how and when processes and their dependents should be restarted

- Using `gen_server` processes as a standard template for how a thread should be running

There's more to mine from using the BEAM, but I think the above are some of the most important aspects. The first two I've never found to be fully replicated anywhere other than in OTP/BEAM. You don't need them, but once you're bought into the BEAM they're incredibly nice to have.

replies(1): >>46030387 #
6. fuzztester ◴[] No.46030387{5}[source]
Thanks.