> Like a modern C with lessons learned.
Yet no string types. So lessons not so well learned. Zig does remove many warts in C.
> Like a modern C with lessons learned.
Yet no string types. So lessons not so well learned. Zig does remove many warts in C.
It has proper arrays and slices, even being able to define a sentinel value in the type system, so you know when it is a C string or a slice with a specific size with arbitrary values. Strings can become a problem if you need another encoding than the chosen one. Then you start to use byte slices anyway. You need to allocate a new one if you want to change just a part of it. Safer yes, but can produce unwanted overhead and you have to duplicate many APIs for strings and byte arrays as it is the case in Go.
It feels like C but raised with Java as its strict stepfather.
Many of those warts were already not present in other systems languages predating C, and others of similar age.