News for hackers. Stuff that matters.
Re:Samurai: Ninja-compatible build tool written in C by sweetgiorni on Sunday August 14, 2022 @01:08AM (#32456525)
Neat, 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.
Re:Samurai: Ninja-compatible build tool written in C by lmz on Sunday August 14, 2022 @02:10AM (#32456834)
Maybe it saves them from having to build a c++ compiler to build ninja.
Re:Samurai: Ninja-compatible build tool written in C by rleigh on Sunday August 14, 2022 @04:54AM (#32457666)
Doubtful. 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.

Re:Samurai: Ninja-compatible build tool written in C by Rochus on Sunday August 14, 2022 @06:17AM (#32458054)
You 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.

Re:Samurai: Ninja-compatible build tool written in C by hulitu on Sunday August 14, 2022 @07:37AM (#32458420)
Compiling gcc <= 4.8 is an exercise in pain because it needs some kernel headers which were removed.
Re:Samurai: Ninja-compatible build tool written in C by Rochus on Sunday August 14, 2022 @07:47AM (#32458482)
Not a big issue for someone who maintains his own Linux version, https://github.com/oasislinux/oasis.
Re:Samurai: Ninja-compatible build tool written in C by mburee on Sunday August 14, 2022 @05:08AM (#32457724)
Ehhh, 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
Re:Samurai: Ninja-compatible build tool written in C by ducktective on Sunday August 14, 2022 @02:52AM (#32457055)
C project, C build tool.

There is also Muon [1] for Meson (Python).

[1]: https://sr.ht/~lattis/muon/

Re:Samurai: Ninja-compatible build tool written in C by jcelerier on Sunday August 14, 2022 @09:01AM (#32458896)
I assume you're also not using a C compiler written in C++, thus neither clang, GCC nor msvc ?
Re:Samurai: Ninja-compatible build tool written in C by ducktective on Sunday August 14, 2022 @09:15AM (#32458995)
It's always beneficial if some people choose to follow idealistic routes ;)

There are minimal C compilers written in C around, though, admittedly, not as relevant as GCC/clang/MSVC

Re:Samurai: Ninja-compatible build tool written in C by jcelerier on Sunday August 14, 2022 @09:25AM (#32459053)
> It's always beneficial if some people choose to follow idealistic routes ;)

As much as I believe this to be true in politics, I think it's really really wrong, if not actively harmful, in tech

Re:Samurai: Ninja-compatible build tool written in C by Rochus on Sunday August 14, 2022 @06:27AM (#32458103)
Muon is a very nice project; especially the bootstrap means are great; unfortunately it doesn't seem to run on Windows and personally I don't think that Meson is a much better system/language than e.g. CMake; otherwise I would have used Muon instead of implementing BUSY.
Re:Samurai: Ninja-compatible build tool written in C by plorkyeran on Sunday August 14, 2022 @01:06AM (#32456512)
Why 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.
Re:Samurai: Ninja-compatible build tool written in C by ori_b on Sunday August 14, 2022 @02:47AM (#32457028)
The 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://sr.ht/~mcf/cproc/

Re:Samurai: Ninja-compatible build tool written in C by BaculumMeumEst on Sunday August 14, 2022 @02:51AM (#32457046)
“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
Re:Samurai: Ninja-compatible build tool written in C by plorkyeran on Sunday August 14, 2022 @10:37AM (#32459606)
Ninja 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.
Re:Samurai: Ninja-compatible build tool written in C by eska on Sunday August 14, 2022 @07:23AM (#32458359)
It not depending on Python seems useful for non-Python ecosystems.
Re:Samurai: Ninja-compatible build tool written in C by toastal on Sunday August 14, 2022 @02:32AM (#32456953)
Probably for teams that fight for honor and need an armored defense bonus to withstand medium to heavy attacks
Re:Samurai: Ninja-compatible build tool written in C by mathstuf on Sunday August 14, 2022 @12:08PM (#32460374)
Neat. 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.

Re:Samurai: Ninja-compatible build tool written in C by einpoklum on Sunday August 14, 2022 @10:23AM (#32459491)
This reminds me of yet another alternative implementation of ninja: N2

https://news.ycombinator.com/item?id=30806875

Re:Samurai: Ninja-compatible build tool written in C by trebcon on Sunday August 14, 2022 @11:54AM (#32460256)
Notably this is made by the original author of Ninja.
Re:Samurai: Ninja-compatible build tool written in C by riffraff on Sunday August 14, 2022 @09:47AM (#32459203)
I feel the name should have been "Shinobi" for maximum pun-ity
Re:Samurai: Ninja-compatible build tool written in C by dragontamer on Sunday August 14, 2022 @12:46PM (#32460700)
Depends.

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.

Re:Samurai: Ninja-compatible build tool written in C by fomine3 on Sunday August 14, 2022 @08:16PM (#32464438)
make/kati is another example, Meaning lose/win in Japanese.
Re:Samurai: Ninja-compatible build tool written in C by tpoacher on Sunday August 14, 2022 @02:34PM (#32461672)
> written in C

this phrase is such rarity in titles these days, that it is newsworthy in itself.