TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Memoize – a replacement for make relying on strace

81 pointsby aarturabout 10 years ago

9 comments

pbiggarabout 10 years ago
I played around with this a few years back when looking at build tools. strace is ungodly slow, and I wouldn&#x27;t recommend using this for anything real. When I looked into why, it&#x27;s basically the time it takes to print and read from strace - printing to stdout every time there is a syscall is obviously very slow.<p>Instead you can use tup, though someone mentioned it now requires Fuse, which obviously isn&#x27;t good. So instead you can use an LD_PRELOAD to record all the file accesses, which is what I think tup used to do.<p>There is also some filesystem thing added to git that let&#x27;s introspect file access, though I don&#x27;t recall the details.<p>That said, I think memoize is the first use of this technique (record actual file accesses dynamically for dependency tracking), which is utterly genius. I worked with Bill McCloskey who wrote it, and he is an incredibly smart dude. He did a lot of work on making Firefox&#x27;s GC better over the last few years.
评论 #9358876 未加载
评论 #9360444 未加载
comexabout 10 years ago
See also fabricate, a script inspired by memorize that works on Windows:<p><a href="https:&#x2F;&#x2F;code.google.com&#x2F;p&#x2F;fabricate&#x2F;" rel="nofollow">https:&#x2F;&#x2F;code.google.com&#x2F;p&#x2F;fabricate&#x2F;</a><p>I tried to contribute OS X support years ago but was too lazy to spend the time to polish it - sorry!<p>Neither tool supports any sort of parallelism, which caused me to eventually give up on them. (It is possible in theory! Though in the worst case it requires killing compiler invocations and rerunning them.)<p>Edit: Apparently fabricate does support parallel execution now, which is neat, but only with explicit markers, which I expect is somewhat detrimental to the magic feel of these tools... maybe I should try it. In the previous parenthetical I meant automatically detecting what can be run in parallel.
评论 #9357592 未加载
dudusabout 10 years ago
This has nothing to do with Memoization [1] that Python already have out of the box through `functools.lru_cache` [2]<p>This is just a very bad naming choice for this library that seems to be an OK alternative to Make.<p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Memoization" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Memoization</a><p>[2] <a href="https:&#x2F;&#x2F;docs.python.org&#x2F;3&#x2F;library&#x2F;functools.html#functools.lru_cache" rel="nofollow">https:&#x2F;&#x2F;docs.python.org&#x2F;3&#x2F;library&#x2F;functools.html#functools.l...</a>
评论 #9357449 未加载
评论 #9358666 未加载
pdqabout 10 years ago
I believe tup [1] uses a similar technique for compile dependency tracking.<p>[1] <a href="http:&#x2F;&#x2F;gittup.org&#x2F;tup&#x2F;ex_dependencies.html" rel="nofollow">http:&#x2F;&#x2F;gittup.org&#x2F;tup&#x2F;ex_dependencies.html</a>
rlpbabout 10 years ago
If you&#x27;re interested in a make replacement, check out redo (designed by djb):<p><a href="http:&#x2F;&#x2F;cr.yp.to&#x2F;redo.html" rel="nofollow">http:&#x2F;&#x2F;cr.yp.to&#x2F;redo.html</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;apenwarr&#x2F;redo" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;apenwarr&#x2F;redo</a>
ameliusabout 10 years ago
Nice, but a problem with this approach is that strace is not &quot;re-entrant&quot;. That is you can&#x27;t strace a program that uses strace (or more precisely, the ptrace syscall).
malkiaabout 10 years ago
I believe MSBuild is doing something similar (but on Windows) - <a href="https:&#x2F;&#x2F;github.com&#x2F;Microsoft&#x2F;msbuild&#x2F;tree&#x2F;master&#x2F;src&#x2F;Utilities&#x2F;TrackedDependencies" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Microsoft&#x2F;msbuild&#x2F;tree&#x2F;master&#x2F;src&#x2F;Utiliti...</a>
评论 #9357922 未加载
efarefabout 10 years ago
Every few years someone tries to reinvent make, and they usually end up with some unholy mess that complicates build systems or causes maintenance nightmares, and is never quite as good.<p>It turns out that make&#x27;s syntax is actually quite simple and appropriate if you take a day or so to learn it properly. It&#x27;s such a fantastic tool that if its syntax was really that problematic, someone would have created a new syntax front-end to GNU make by now. The fact that they haven&#x27;t speaks volumes: by the time you learn enough to be able to do it, you realise you can&#x27;t really come up with anything better.
imglorpabout 10 years ago
See also these things. But memoize.py looks more flexible; building anything.<p><pre><code> ccache - https:&#x2F;&#x2F;ccache.samba.org fastbuild - http:&#x2F;&#x2F;fastbuild.org </code></pre> Also for the besodden remaining ClearCase users, they have nice feature which seems rarely spoken of these days: clearmake and wink-ins.
评论 #9357911 未加载