3 ms·
> Like a modern C with lessons learned. Yet no string types. So lessons not so well learned. Zig does remove many warts in C.
by metaltyphoon 1y ago
> Like a modern C with lessons learned.
Yet no string types. So lessons not so well learned. Zig does remove many warts in C.
- ManBeardPc 1y agoIt 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.
- pjmlp 1y agoMany of those warts were already not present in other systems languages predating C, and others of similar age.
- user____name 1y agoIt feels like C but raised with Java as its strict stepfather.