8 ms·
Interesting language. I do find the statements a bit ‘absolute’, eg higher performance than C. In terms of what? Floating point, concurrent processing, ...?
by hestefisk 8y ago
Interesting language. I do find the statements a bit ‘absolute’, eg higher performance than C. In terms of what? Floating point, concurrent processing, ...?
- mschwaig 8y agoIn their phylosophy C and zig both aim to do very little behind the scenes beyond what you explicitly express in your code. On a technical level Zig re-uses fancy C compiler infrastructure in the form of LLVM. So that gets them pretty close. The advantage tha zig has over C is that it gets designed decades later when we have learned so much about what is good or bad or fast or slow about C.
- hestefisk 8y agoThe same could be said for Go. And it still doesn’t explain the statement on performance. I see nothing close to objective benchmarks. I think the language is interesting though and hope this will be published.
- nine_k 8y agoC's simplicity leads to fewer guarantees, this makes some optimizations impossible. E.g. Fortran used to be faster than C in numerical code, because the guarantee of no aliasing allows for more aggressive optimizations. Maybe Zig has something in this department, too.
- AndyKelley 8y agoCross posting from https://www.reddit.com/r/programming/comments/bjwhm5/introduction_the_zig_programming_language/emc30to/ https://www.reddit.com/r/programming/comments/bjwhm5/introdu... Parameters can have `noalias` on them. This is [currently undocumented](https://github.com/ziglang/zig/issues/1521 https://github.com/ziglang/zig/issues/1521) and [not yet safety checked](https://github.com/ziglang/zig/issues/476 https://github.com/ziglang/zig/issues/476) and there is an [open area of research considering doing it the opposite way](https://github.com/ziglang/zig/issues/1108 https://github.com/ziglang/zig/issues/1108). Provided that it could be safety-checked, opt-in aliasing has the potential to make Zig even faster. As far as I'm aware, this is currently the only way in which Rust could potentially outperform Zig (and C).
- flukus 8y ago> C's simplicity leads to fewer guarantees, this makes some optimizations impossible. I know that's the theory, but with few exceptions this doesn't seem to have panned out in reality anywhere and C is usually still the gold standard when it come to performance. How many more decades until we get these sufficiently smart compilers?