logoalt Hacker News

ACCount37today at 11:00 AM6 repliesview on HN

No, I get that, but Zig being low level is kind of why I don't get why it would be a good tinkering language?

When I want to tinker, I just want my logic to work, first of all. In 9 cases out of 10 that means going for high level. Even if the resulting code works with low level things like binary structures.


Replies

andyferristoday at 11:24 AM

Low-level programming gets a bad name because C has many footguns and the spec leaves much behavior undefined - a fact that implementers use almost adversarially (which I'd support, if the goal was to refine the spec...).

C++ adds more high-level conveniences without actually removing the footguns and undefined behavior (much C code compiles in a C++ compiler).

Zig tries to keep the low-level C philosophy but have things more well factored and well defined. The result is you _can_ tinker in high-level code, yet "drop down" into low-level code as you desire.

(Compared to rust, you get fewer compiler-enforced guarantees, but unlike C the language isn't trying to make high-level code adversarial).

show 2 replies
mcdonjetoday at 11:30 AM

You have a weirdly restrictive definition of "tinker"

show 2 replies
brabeltoday at 11:39 AM

Tinkering means different things to different people! Want to tinker with your hardware, as bare metal as possible? Or extract every inch of performance out of your CPU? Zig is great for that.

pmarrecktoday at 2:01 PM

> I just want my logic to work

what the heck has convinced you that logic is somehow flawed in a new low-level language? LOLLL