[HN Gopher] N2: Alternative Ninja Implementation
___________________________________________________________________
N2: Alternative Ninja Implementation
Author : ingve
Score : 30 points
Date : 2022-03-25 20:46 UTC (2 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| secure wrote:
| Corresponding blog post:
| http://neugierig.org/software/blog/2022/03/n2.html
| boardwaalk wrote:
| I'm a little confused by some of this (mtime vs manifest)
| because Ninja does rebuild things if things like the command
| line changes, doesn't it? Or have I misunderstood how this tool
| works forever...
| einpoklum wrote:
| Nutshell summary of the post:
|
| Instead of relying on modification-time comparisons between
| dependency and target output, use hashes of the relevant
| "ingredients" of building a target (cmdline, arguments, meta-
| data about input files etc.).
| cmrdporcupine wrote:
| Well, HN commenters will like this: Something rewritten in Rust
| without advertising that as its primary feature.
| AceJohnny2 wrote:
| The author mentions it, and I highly recommend anybody interested
| in build systems read the seminal paper Build Systems A La Carte
| [1], which breaks down various build systems (including Excel!)
| into their component concepts, and along the way finds a new
| feature-space that hadn't been explored.
|
| [1] https://www.microsoft.com/en-
| us/research/uploads/prod/2018/0...
|
| (an understanding of Haskell is recommended to understand the
| implementations, but not required to understand the concepts)
| gkbrk wrote:
| Shameless plug, I also wrote my own Ninja implementation [1]. I
| tried to make it easy to understand, while supporting all the
| Ninja features I used.
|
| In the end, it was able to compile my own kernel and a few other
| Ninja projects.
|
| [1]: https://github.com/gkbrk/scripts/blob/master/ninja.py
| einpoklum wrote:
| To improve your shameless plug, you should tell us:
|
| * What your motivation for writing it was.
|
| * Why people might like to use it instead of ninja or n2.
| sylware wrote:
| and we should not forget about the simple C (C99) re-
| implementation of ninja from M. Forney:
|
| https://github.com/michaelforney/samurai
| einpoklum wrote:
| What are the benefits of the C implementation? I noticed the
| adherence to POSIX command-line conventions, but that doesn't
| sound like a good enough reason for a reimplementation in a
| different language.
| floatboth wrote:
| I guess the ability to work in really restricted/minimal
| environments where you only have a simple C compiler like
| tcc, and nothing like LLVM. Or paranoid environments where
| you can only use CompCert. Something like that.
___________________________________________________________________
(page generated 2022-03-25 23:01 UTC)