←back to thread

Open-source Zig book

(www.zigbook.net)
692 points rudedogg | 1 comments | | HN request time: 0.195s | source
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 #
IshKebab ◴[] No.45951799[source]
I guess comptime is a little different but yeah I wouldn't say it fundamentally changes how you think about software.

I wouldn't say that about OCaml either really though. It's not wildly different in the way that e.g. Lean's type system, or Rust's borrow checker or Haskell's purity is.

replies(1): >>45952085 #
vlovich123 ◴[] No.45952085[source]
D has similar comptime capabilities if I recall correctly and proceeds Zig by almost 2 decades or so.
replies(1): >>45952592 #
IshKebab ◴[] No.45952592[source]
I don't think it's the same. You can do template metaprogramming, but Zig lets you use Zig itself which is a lot nicer.

I'm not a D programmer though so I could be wrong.

replies(1): >>45955656 #
1. vlovich123 ◴[] No.45955656[source]
I’m not a D programmer but I remember talks by Alexandrescu where he was arguing for this capability in C++ and ultimately one of his stated reasons why he switched from C++ to D

Look up static if - AST manipulation in native D code.