Skip to content

Comment on Zig is everything I want C to beparent

Comments

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.

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.

We had ctags for lack of better alternatives, not because it’s any good

lsp can be extremely slow, on constrained devices

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.