-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathideas.txt
executable file
·66 lines (36 loc) · 2.92 KB
/
ideas.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Shake inevitablility/refactoring
---------------------------------------------------------------------
Ninjasmith
---------------------------------------------------------------------
Ninja semantics
---------------------------------------------------------------------
How to write a Monoid with Monad syntax, like the Shake rules Monad, which is a WriterT thingy. You need to make an extra kind the wire it up.
---------------------------------------------------------------------
Applicative Make vs Shake Monad. See Shake-Monad.hs for the code.
---------------------------------------------------------------------
Progress reporting in Shake, and how awesome it is. "Erdi, Gergo: showing the estimated build time remaining in the terminal window's title is genius. you can quote me on that :)"
---------------------------------------------------------------------
New command functions in Development.Shake.Command. In particular, use [x] around filenames.
---------------------------------------------------------------------
How you should write things in Shake, properly abstracting the command line bit:
"result.tar" *> \out ->
createTar out ["file1","file2"]
"result.tar" *> \out ->
createTar out =<< readFileLines "list.txt"
createTar out src = do
need src
cmd "tar -cf" [out] src
---------------------------------------------------------------------
Shake vs Ninja
---------------------------------------------------------------------
GNU Make command line vs Shake, also command line handling in Shake
---------------------------------------------------------------------
Optimising Shake
Macker: Shake is also obsessed about minimal incremental build changes and correctness. Some evidence for incremental time:
* I rewrote the storage layer so incremental changes don't involve writing the metadata (http://neilmitchell.blogspot.co.uk/2012/06/shake-storage-layer.html).
* The inner build algorithm is highly optimised to reduce things like lock contention in incremental builds (http://community.haskell.org/~ndm/downloads/paper-shake_before_building-10_sep_2012.pdf, S4.3)
* The file modification time checks are highly optimised and keep at bytes out of structures (https://github.com/ndmitchell/shake/blob/master/Development/Shake/FileTime.hs).
The end result is that for an no-op build, running ghc --make to build a 30 module build system takes longer than running a 30,000 object build system. Checking modification time from the disk dominates, and that is highly optimised.
I have yet to benchmark Shake against Ninja. There are a few reasons I think Ninja might win (better on-disk serialisation) and a few reasons I think Shake might win (rules are statically compiled), so will have to try it to find out.
---------------------------------------------------------------------
Interpetting build metadata in Shake - how to do build.mk style things