Hacker News new | ask | show | jobs
by codethief 371 days ago
> Yeah but what is up with all that "." and "@"

"." = 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.

1 comments

I know what these are, but they are noise to me.
It's not annotation noise however, it's syntax noise.
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.
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 `@`

I hate C++, too.
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

FWIW: I hate C++, too.