| > but isn't this undermined by the lack of memory safety? IMO, partially. But zig isn't done, so we probably can't judge that yet. Now, zig does have good memory safety. It's not at the level of Javascript or Rust, but it's not like C either. Last I checked -- a while ago now -- user-after-free was a major issue in zig. IMO, that has to be addressed or zig really has no future. Javascript really is a memory safe language. But its runtime and level of abstraction doesn't work for "systems programming". For systems programming, I think you want (1) memory safety by default with escape hatches; and (2) a "low" level of abstraction -- basically one step above the virtual PDP-11 that compilers and CPUs have generally agreed on to target. That's to let the programmer think in terms of the execution model the CPU supports without dealing with all the details. And as a kind of addendum to (2), it needs to interop with C really well. Rust has (1) nailed, I think. (2) is where it's weak. The low level is in there, but buried under piles of language feature complexity. Also, it disallows some perfectly safe memory management patterns, so you either need to reach for unsafe too often, or spend time contorting the code to suit the solution space (rather than spending time productively, on the problem space). Zig is weak on (1). It has some good features, but also some big gaps. It's quite strong on (2) though. My hope for zig -- don't know if it will happen or not -- is that it provides memory safety by default, but in a significantly more flexible way than rust, and maintains it's excellent characteristics for (2). |