News for hackers. Stuff that matters.
Re:Zig is everything I want C to be by znpy on Tuesday October 22, 2024 @03:11PM (#41917615)
> Use of the fn keyword makes it easy to find function definitions by grepping for it, whereas finding functions in regular C syntax needs semantic awareness.

does it matter though, in 2024 and beyond?

we've got clangd and lsp, grepping for functions is dumb, whether you're grepping C or grepping Zig.

Re:Zig is everything I want C to be by tmtvl on Wednesday October 23, 2024 @09:09AM (#41924707)
We've had Ctags since 1992, so being able to grep for functions hasn't been important for 32 years... but there's still people who prefer to use grep to look for functions, so having a specific keyword is beneficial for them. It may also make the lex/parse/generate cycle simpler, but I'm not a compiler engineer, so I don't know for certain whether it does.
Re:Zig is everything I want C to be by znpy on Thursday October 24, 2024 @03:38PM (#41938956)
We had ctags for lack of better alternatives, not because it’s any good
Re:Zig is everything I want C to be by g-b-r on Wednesday October 23, 2024 @11:54PM (#41931748)
lsp can be extremely slow, on constrained devices