Re:Low-Level Optimization with Zig
by johnisgood on Saturday June 07, 2025 @06:12AM
(#44208651)
I know what these are, but they are noise to me.
Re:Low-Level Optimization with Zig
by pyrolistical on Saturday June 07, 2025 @12:46PM
(#44210778)
It is waaaaaaay less noisy than c++
C syntax may look simpler but reading zig is more comfy bc there is less to think about than c due to explicit allocator.
There is no hidden magic with zig. Only ugly parts. With c/c++ you can hide so much complexity in a dangerous way
Re:Low-Level Optimization with Zig
by johnisgood on Saturday June 07, 2025 @02:42PM
(#44211639)
FWIW: I hate C++, too.
It's not annotation noise however, it's syntax noise.
Re:Low-Level Optimization with Zig
by johnisgood on Saturday June 07, 2025 @03:07PM
(#44211833)
Thanks for the correction. Is it really not "annotation"? What makes the difference?
You're not providing extra information to the compiler, clarifying the intent, but merely follow the requirements of the language when writing . to infer the type or @ to use a built-in function.
Re:Low-Level Optimization with Zig
by johnisgood on Sunday June 08, 2025 @03:50AM
(#44215405)
Thank you. My previous comment got down-voted despite it being a legitimate question, weird times.
C++'s `::` vs Zig's `.`
C++'s `__builtin_` (or arguably `_`/`__`) vs Zig's `@`
Re:Low-Level Optimization with Zig
by johnisgood on Saturday June 07, 2025 @02:41PM
(#44211633)
I hate C++, too.
"." = the "namespace" (in this case an enum) is implied, i.e. the compiler can derive it from the function signature / type.
"@" = a language built-in.