summary refs log tree commit diff stats
path: root/compiler/ic/design.rst
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/ic/design.rst')
-rw-r--r--compiler/ic/design.rst21
1 files changed, 20 insertions, 1 deletions
diff --git a/compiler/ic/design.rst b/compiler/ic/design.rst
index 60434e4b8..d8e1315b1 100644
--- a/compiler/ic/design.rst
+++ b/compiler/ic/design.rst
@@ -33,9 +33,28 @@ are rod-file specific too.
 Global state
 ------------
 
-Global persistent state will be kept in a project specific `.rod` file.
+There is no global state.
 
 Rod File Format
 ---------------
 
 It's a simple binary file format. `rodfiles.nim` contains some details.
+
+
+Backend
+-------
+
+Nim programmers have to come to enjoy whole-program dead code elimination,
+by default. Since this is a "whole program" optimization, it does break
+modularity. However, thanks to the packed AST representation we can perform
+this global analysis without having to unpack anything. This is basically
+a mark&sweep GC algorithm:
+
+- Start with the top level statements. Every symbol that is referenced
+  from a top level statement is not "dead" and needs to be compiled by
+  the backend.
+- Every symbol referenced from a referenced symbol also has to be
+  compiled.
+
+Caching logic: Only if the set of alive symbols is different from the
+last run, the module has to be regenerated.
12 +0530 Fix dates in README' href='/andinus/octans/commit/README.org?id=5da030439368ed417694486a9c5275167db1b988'>5da0304 ^
e748809 ^

015b208 ^
9a2e713 ^
015b208 ^
9a2e713 ^



015b208 ^

015b208 ^
9a2e713 ^


015b208 ^

^
9a2e713 ^
5bb0f22 ^

b6ef792
5bb0f22 ^

e748809 ^
5bb0f22 ^






b6ef792
9a2e713 ^
7419384 ^

b6ef792
9a2e713 ^
b6ef792
9a2e713 ^

b6ef792
5bb0f22 ^
9a2e713 ^
e68e68e ^
9a2e713 ^
e68e68e ^
9a2e713 ^
c78971d ^
9a2e713 ^
c78971d ^

5bb0f22 ^





e748809 ^
b6ef792
9a2e713 ^
b6ef792
015b208 ^

9a2e713 ^







c90dba1 ^
9a2e713 ^
c90dba1 ^

147ac7b ^
9a2e713 ^
147ac7b ^

5da0304 ^
9a2e713 ^
015b208 ^

5da0304 ^
9a2e713 ^


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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137