Page 1 of 1

Support for Samurai (C99 Ninja alternative)

Posted: 02 Dec 2023, 14:02
by mjo
Hi, Samurai (https://github.com/michaelforney/samurai) is a drop-in C99 replacement for the "ninja" command. If it's not too much trouble, could you allow ./configure to proceed if "samu" is installed instead of "ninja"? Or perhaps skip the check if $NINJA is set in the environment?

Polymake is already halfway to supporting Samurai, because the top-level Makefile calls $NINJA instead of "ninja", so people can run e.g. NINJA=samu make to override the command. The only roadblock is that ./configure won't let them get that far.

We have automatic support for Samurai in Gentoo and this would let our users use it without having to install a superfluous copy of ninja to fake out the configure script. If you're wondering why anyone would want to reimplement ninja in C, it's partially for speed and partially to avoid chicken-and-egg problems in the build. (The latter can be especially annoying on a distro where everything is built from source.)

Re: Support for Samurai (C99 Ninja alternative)

Posted: 03 Dec 2023, 00:40
by gawrilow
Hi, Samurai (https://github.com/michaelforney/samurai) is a drop-in C99 replacement for the "ninja" command. If it's not too much trouble, could you allow ./configure to proceed if "samu" is installed instead of "ninja"? Or perhaps skip the check if $NINJA is set in the environment?

Polymake is already halfway to supporting Samurai, because the top-level Makefile calls $NINJA instead of "ninja", so people can run e.g. NINJA=samu make to override the command. The only roadblock is that ./configure won't let them get that far.
Surely we can do this (using the env. var.) provided that both tools are really interchangeable. In the meanwhile you could simply unblock the builds by creating a symlink ninja->samu, e.g. via /etc/alternatives.

You've said that samurai is faster than ninja. To be honest, I never perceived ninja as slow, even on rather big projects with several 10k binary targets. Now I'm just curious: can rewriting a C++ program in C99 still make it faster, or have there also been made some algorithmic improvements?