TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The success and failure of Ninja (2020)

297 点作者 quincepie6 个月前

14 条评论

willvarfar6 个月前
&gt; we talk about programming like it is about writing code, but the code ends up being less important than the architecture, and the architecture ends up being less important than social issues.<p>A thousand times this! This puts into words something that&#x27;s been lurking in the back of my mind for a very long time.
评论 #42268704 未加载
评论 #42268735 未加载
评论 #42268947 未加载
评论 #42268633 未加载
评论 #42275795 未加载
评论 #42268906 未加载
dang6 个月前
Discussed at the time:<p><i>The Success and Failure of Ninja</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23157783">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23157783</a> - May 2020 (38 comments)<p>(Reposts are fine after a year or so! links to past threads are just to satisfy extra-curious readers)
defer6 个月前
This is hilarious to me:<p><pre><code> Android, which uses it for some large component of the system that I&#x27;ve never quite understood </code></pre> Ninja is really a huge part of AOSP, the build system initially used makefiles. Things got complex really fast with a custom declarative build system (soong) and a failed&#x2F;aborted migration to bazel. Google developed kati (<a href="https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;kati">https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;kati</a>) which converts Makefiles to ninja build files (or should I say file), which really is huge:<p><pre><code> λ wc -l out&#x2F;build-qssi.ninja 3035442 out&#x2F;build-qssi.ninja </code></pre> Going from makefiles&#x2F;soong to ninja is painful, it takes several minutes even in a modern machine but it simply flies once ninja picks it up.
评论 #42275778 未加载
high_priest6 个月前
&gt; I also believe that programmers feel latency and it affects their mood even if they don&#x27;t notice it. (Google has recently done some research in this area that kinda confirmed my belief, here&#x27;s hoping they&#x27;ll publish it publicly!)<p>Anyone knows if it happened? Has the google research on latency been published?
评论 #42270313 未加载
评论 #42281111 未加载
forrestthewoods6 个月前
Ninja is pretty popular with gamedevs.<p>I was amused by this line:<p>&gt; But Windows is still a huge platform in terms of developers, and those developers are starved for tools.<p>As a primarily Windows dev I feel that it is poor Linux devs who are starved for tools! Living life without a good debugger (Visual Studio) or profiler (Superluminal) is so tragic. ;(<p>It does feel like in recent years the gap between the two platforms is increasingly minimal. I definitely like all the Rust utilities that generally work crossplatform for example.
评论 #42275108 未加载
评论 #42273238 未加载
评论 #42274569 未加载
mgaunard6 个月前
I switched to samurai for the few things I have that still used ninja; it&#x27;s an improvement in every possible way.<p>But regardless, I think those kinds of build systems are just wrong. What I want from a build system is to hash the content of all the transitive inputs and look up if it exists or not in a registry.
评论 #42272999 未加载
评论 #42269259 未加载
评论 #42269209 未加载
评论 #42270490 未加载
评论 #42273093 未加载
评论 #42271845 未加载
评论 #42271528 未加载
评论 #42269086 未加载
pjmlp6 个月前
Given that ninja is required for C++20 modules when using CMake, it is going to stay around for quite a bit.
edflsafoiewq6 个月前
Most interesting point to me<p>&gt; You must often compromise between correctness and convenience or performance and you should be intentional when you choose a point along that continuum. I find some programmers are inflexible when considering this dynamic, where it&#x27;s somehow obvious that one of those concerns dominates, but in my experience the interplay is pretty subtle; for example, a tool that trades off correctness for convenience might overall produce a more correct ecosystem than a more correct but less convenient alternative, if programmers end up avoiding the latter.
评论 #42275717 未加载
zX41ZdbW6 个月前
&gt; Relatedly, please forgive me for the embarrassing name.<p>The name is great!<p>PS. It&#x27;s possible to make it even faster if we implement this: <a href="https:&#x2F;&#x2F;github.com&#x2F;ninja-build&#x2F;ninja&#x2F;issues&#x2F;2157">https:&#x2F;&#x2F;github.com&#x2F;ninja-build&#x2F;ninja&#x2F;issues&#x2F;2157</a> But you explained in the article that the tool intentionally lacks state, even tiny hints from previous runs.
grobibi6 个月前
I thought this was going to be about people buying less air fryers.
评论 #42269468 未加载
评论 #42269106 未加载
bakudanen6 个月前
I had my stint with build systems. Nx, Bazel to name a few. In the past I was always the go to guy to configure these stuffs.<p>OP said that ninja is small enough to be implemented in your favorite programming language. I wonder if there is step by step tutorial to create your own build system?
评论 #42276300 未加载
santoshalper6 个月前
Man, I was so afraid this was going to be about Fortnite. Turns out it was a fantastic read. I feel really sad but unsurprised about his description of what it&#x27;s like to be an Open Source maintainer.
einpoklum6 个月前
### Statistics ###<p>ninja has ~26 kloc, ~3,100 commits, and only a quarter of them by the original author (although by loc changed their weight is higher). Interesting!<p><a href="https:&#x2F;&#x2F;github.com&#x2F;ninja-build&#x2F;ninja&#x2F;graphs&#x2F;contributors">https:&#x2F;&#x2F;github.com&#x2F;ninja-build&#x2F;ninja&#x2F;graphs&#x2F;contributors</a><p>### Bunch of other comments ###<p><i>&gt; users of ninja ... all Meson projects, which appears to increasingly be the build system used in the free software world;</i><p>So, AFAICT, that hasn&#x27;t turned out to be the case.<p><i>&gt; the code ends up being less important than the architecture, and the architecture ends up being less important than social issues.</i><p>Well... sometimes. Other times, the fact that there&#x27;s good code that does something goes a very long way, and people live with the architectural faults. And as for the social issues - they rarely stand in opposition to the code itself.<p><i>&gt; Some pieces of Ninja took struggle to get to and then are obvious in retrospect. I think this is true of much of math</i><p>Yup. And the some of the rest of math becomes obvious when some re-derives it using alternative and more convenient&#x2F;powerful techniques.<p><i>&gt; I think the reason so few succeed at this is that it&#x27;s just too tempting to mix the layers.</i><p>As an author of a library that also focuses on being a &quot;layer&quot; of sorts (<a href="https:&#x2F;&#x2F;github.com&#x2F;eyalroz&#x2F;cuda-api-wrappers&#x2F;">https:&#x2F;&#x2F;github.com&#x2F;eyalroz&#x2F;cuda-api-wrappers&#x2F;</a>), I struggle with this temptation a lot! Especially when, like the author says, the boundaries of the layers are not as clear as one might imagine.<p><i>&gt; I strongly believe that iteration time has a huge impact on programmer satisfaction</i><p>I&#x27;m pretty certain that the vast majority developers perform 10x more incremental builds than full builds. So, not just satisfaction - it&#x27;s just most of what we do. It&#x27;s also those builds which we wait-out rather than possible go look for some distraction:<p><a href="https:&#x2F;&#x2F;xkcd.com&#x2F;303&#x2F;" rel="nofollow">https:&#x2F;&#x2F;xkcd.com&#x2F;303&#x2F;</a><p>OTOH, the article doesn&#x27;t mention interaction with build artifact caching schemes, which lessen the difference between building from scratch and building incrementally.<p><i>&gt; Peter Collingbourne found Ninja and did the work to plug it into the much more popular CMake ... If anyone is responsible for making Ninja succeed out there in the real world, Peter is due the credit.</i><p>It is so gratifying when a person you didn&#x27;t know makes your software project that much more impactful! Makes you really feel optimistic again about humanity and socialism and stuff.
评论 #42268687 未加载
burrish6 个月前
Damn and here I was expecting real Ninjas