7 ms·
Samurai: Ninja-compatible build tool written in C
- einpoklum 4y agoThis reminds me of yet another alternative implementation of ninja: N2 https://news.ycombinator.com/item?id=30806875 https://news.ycombinator.com/item?id=30806875
- trebcon 4y agoNotably this is made by the original author of Ninja.
- plorkyeran 4y agoWhy would I want to use this instead of ninja? It’s apparently a drop-in replacement but it doesn’t say what it’s trying to do better than the original.
- deleted 4y ago[deleted]
- toastal 4y agoProbably for teams that fight for honor and need an armored defense bonus to withstand medium to heavy attacks
- ori_b 4y agoThe code is readable and maintainable, and can be used in the Linux distro that the author maintains without pulling in a huge number of dependencies to build a C++ compiler. https://github.com/oasislinux/oasis https://github.com/oasislinux/oasis https://sr.ht/~mcf/cproc/ https://sr.ht/~mcf/cproc/
- BaculumMeumEst 4y ago“written in C99 with a focus on simplicity, speed, and portability” is what appears to differentiate it from ninja. if that sounds interesting you should check it out and if not skip it
- plorkyeran 4y agoNinja is already fast, simple, and portable, so those aren’t differentiating factors. It appears to just be ninja but written in a different programming language.
- eska 4y agoIt not depending on Python seems useful for non-Python ecosystems.
- sweetgiorni 4y agoNeat, but I wonder what the motivation for this is. I assumed that for the majority of projects ninja itself adds little overhead to the total build time.
- lmz 4y agoMaybe it saves them from having to build a c++ compiler to build ninja.
- rleigh 4y agoDoubtful. Both GCC and LLVM are written in C++ so you have to build a C++ compiler irrespective of whether you actually want one! I suspect it's more that they don't like C++ and want to use C for everything. Whether that actually translates into a higher quality tool or a more performant tool, we can only imagine.
- mburee 4y agoEhhh, the creator also works on a minimalist Linux distro (Oasis) and one of their goals is to build with cproc (a C frontend for the QBE backend), all written in ISO C. He uses Samurai in his distro, so it all fits together pretty well
- Rochus 4y agoYou can just use a GCC version < 4.8 or something like e.g. TCC if you want to avoid C++. Though Ninja is implemented in a very moderate C++ style; I'm able to compile it even with GCC <= 4.8; it even seems to compile on pre-C++11 compilers.
- riffraff 4y agoI feel the name should have been "Shinobi" for maximum pun-ity
- dragontamer 4y agoDepends. The improvement upon the program 'more' was named 'less'. It seems to be a tradition to choose opposites rather than similar words. Samurai were warrior-governors of Japan, much like Knights. Their opposite and enemy were ninjas/Shinobi, the spies and assassin's of Japan.
- fomine3 4y agomake/kati is another example, Meaning lose/win in Japanese.
- mathstuf 4y agoNeat. I like keeping track of ninja implementations (I'm a CMake developer), but it's unfortunate how many end up skipping `dyndep` support (granted, it is not trivial) because it is necessary to reliably build C++20 modules (and Fortran modules FWIW). It's probably fine since it seems to be built for a minimal platform where saying "no" to C++ (nevermind C++20) is possible, but I wonder how many people know that the number of tools that can reliably support C++20 is far smaller than it has been historically.
- tpoacher 4y ago> written in C this phrase is such rarity in titles these days, that it is newsworthy in itself.