|
|
Log in / Subscribe / Register

Linux man pages 6.17 released

Version 6.17 of the Linux manual-page collection has been released. Along with a long list of updates to the man pages themselves, it includes some new utility programs of interest.

The grepc(1) program is something that originated in this project, as it helped me find code quickly in glibc and the Linux kernel. However, I've found it incredibly useful outside of this project. I'll take some space to announce it, as it's much more than just a tool for writing manual pages, and I expect it to be useful to most --if not all-- C programmers.

It is a command-line tool that finds C source code (for example, a function definition) in arbitrary projects. It doesn't use any indexing mechanism (unlike ctags and similar tools). This means that it can be used right after cloning some repository, without having to first generate an index.



to post comments

ast-grep works similarly and for multiple languages.

Posted Feb 11, 2026 22:21 UTC (Wed) by ejr (subscriber, #51652) [Link] (3 responses)

For best mileage, you may need to combine ast-grep's JSON output with jq queries. It is quite powerful. Some of the tree-sitter grammars are a little fiddly, e.g. the direction of pointer binding in C{,++} declarations v. parameter lists. There's also information on integrating ast-grep into "AI" tools for more semantic searches.

grepc seems very focused and much simpler. That can be an advantage in many circumstances... I look forward to its appearing in Debian. And the eventual emacs integration... ;)

ast-grep works similarly and for multiple languages.

Posted Feb 12, 2026 0:12 UTC (Thu) by alx.manpages (subscriber, #145117) [Link] (2 responses)

> grepc seems very focused and much simpler. That can be an advantage in many circumstances...

Yup!

> I look forward to its appearing in Debian. And the eventual emacs integration... ;)

Thanks! I talked with the Debian and Fedora packagers a few months ago about packaging it, and they seemed to intend to package it. I hope it will be widely available soon. :-)

ast-grep works similarly and for multiple languages.

Posted Feb 12, 2026 0:41 UTC (Thu) by csamuel (✭ supporter ✭, #2624) [Link] (1 responses)

Thanks for your work on both this and the man pages project!

ast-grep works similarly and for multiple languages.

Posted Feb 12, 2026 13:01 UTC (Thu) by alx.manpages (subscriber, #145117) [Link]

You're welcome! Thank you for your niceness! :-)

C frontends?

Posted Feb 12, 2026 3:02 UTC (Thu) by pabs (subscriber, #43278) [Link] (5 responses)

Are there any grep tools based on C compiler frontends?

C frontends?

Posted Feb 12, 2026 13:10 UTC (Thu) by alx.manpages (subscriber, #145117) [Link] (2 responses)

There might be something based on LLVM, or at least LLVM provides libraries that would allow implementing such a thing.

However, compiling a project usually takes a long time, so this wouldn't be viable --imagine compiling a kernel to fund the definition of creat(2)--. Or it might use an index to cache stuff. In any case, not something that I'd find usable.

C frontends?

Posted Feb 13, 2026 12:54 UTC (Fri) by swilmet (subscriber, #98424) [Link] (1 responses)

> compiling a project usually takes a long time

Here only the compiler frontend would be used, to re-use the same regexes etc as a real compiler, without invoking the optimization phases nor the backend (no need to write any output files).

C frontends?

Posted Feb 13, 2026 14:08 UTC (Fri) by alx.manpages (subscriber, #145117) [Link]

I tried compiling a project of mine which consists of one header file and one source file, to have some numbers.

Pre-processing is relatively expensive. You need to include all headers before you can even start compiling. In some tests in that small project of mine, the preprocessor takes around one third of the compilation time. This might depend on the project, but I don't expect it to significantly go down.

And after the preprocessor, you need to run the parser, so it would add up a little bit more.

Even if for some project cpp(1) plus parsing took
~5% of the total build time, that would mean 1 minute with all 24 cores for the kernel in my computer.

Also, such a thing would have to know about the build system, as some code might not even compile without special flags (e.g., -I).

I don't think it would be easy.

C frontends?

Posted Feb 19, 2026 13:16 UTC (Thu) by Vorpal (guest, #136011) [Link]

There are LSPs (Language Server Protocol) for many languages, including clangd for C/C++. Those are used to provide such information to IDEs and editors. I wonder if you could make a grep tool based on LSPs as well, it doesn't seem like an entirely unrealistic idea, and it would in theory give you access to many languages just by switching out the backend LSP.

C frontends?

Posted Feb 19, 2026 13:34 UTC (Thu) by taladar (subscriber, #68407) [Link]

ast-grep is the closest I can think of but it is not based on a compiler frontend, just on treesitter grammars.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds