▲ | metaltyphoon 3 days 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 3 days ago | parent | next [-] | |
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. | ||
▲ | pjmlp 2 days ago | parent | prev | next [-] | |
Many of those warts were already not present in other systems languages predating C, and others of similar age. | ||
▲ | user____name a day ago | parent | prev [-] | |
It feels like C but raised with Java as its strict stepfather. |