forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
todo.txt
161 lines (130 loc) · 5.58 KB
/
todo.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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
version 0.9.4
=============
- new VM:
- implement the glue to replace evals.nim
- implement missing magics
- implement overflow checking
- implement the FFI
- make 'bind' default for templates and introduce 'mixin'
- special rule for ``[]=``
- ``=`` should be overloadable; requires specialization for ``=``; general
lift mechanism in the compiler is already implemented for 'fields'
- built-in 'getImpl'
- optimize 'genericReset'; 'newException' leads to code bloat
- stack-less GC
Bugs
====
- compilation of niminst takes way too long. looks like a regression
- simple closure iterator doesn't work
- docgen: sometimes effects are listed twice
- 'result' is not properly cleaned for NRVO --> use uninit checking instead
- sneaking with qualifiedLookup() is really broken!
- aporia.nim(968, 5) Error: ambiguous identifier: 'DELETE' --
use a qualifier
- blocks can "export" an identifier but the CCG generates {} for them ...
- osproc execProcesses can deadlock if all processes fail (as experienced
in c++ mode)
- result = result shr 8 for the "system()" wrapper
version 0.9.x
=============
- macros as type pragmas
- implicit deref for parameter matching
- lazy overloading resolution:
* get rid of ``expr[typ]``, use perhaps ``static[typ]`` instead
* special case ``tyStmt``
- FFI:
* test libffi on windows
* test: times.format with the FFI
- document NimMain and check whether it works for threading
- 'quote' without 'do' doesn't work: parser/grammar issue; could be supported
version 0.9.X
=============
- test&finish first class iterators:
* nested iterators
- implement the missing features wrt inheritance
- better support for macros that rewrite procs
- macros need access to types and symbols (partially implemented)
- perhaps: change comment handling in the AST
- enforce 'simpleExpr' more often --> doesn't work; tkProc is
part of primary!
- the typeDesc/expr unification is weird and only necessary because of
the ambiguous a[T] construct: It would be easy to support a[expr] for
generics but require a[.typeDesc] if that's required; this would also
allow [.ref T.](x) for a more general type conversion construct; for
templates that would work too: T([.ref int])
Concurrency/Effect system
=========================
- shared memory heap: ``shared ref`` etc. The only hard part in the GC is to
"stop the world". However, it may be worthwhile to generate explicit
(or implicit) syncGC() calls in loops. Automatic loop injection seems
troublesome, but maybe we can come up with a simple heuristic. (All procs
that `new` shared memory are syncGC() candidates... But then 'new' itself
calls syncGC() so that's pointless.) Hm instead of an heuristic simply
provide a ``syncgc`` pragma to trigger compiler injection --> more general:
an ``injectLoop`` pragma
- 'writes: []' effect; track reads/writes for shared types
- use the effect system for static deadlock prevention and race detection
- ``~`` operator for effects
- introduce 'noaddr' pragma to prevent taking the address of a location; this
is very handy to prevent aliasing of global data
version 0.9.XX
==============
- document nimdoc properly finally
- make 'clamp' a magic for the range stuff
- better type syntax for functions and tuples: tuple(int, int); (int,int)->int
Memory safety
=============
- object branch transitions from low(selector) are unsafe! ---> Needs a
deprecation path
- object branch transitions can't work with the current 'reset'; add a 'reset'
with an additional parameter --> simple:
provide a 'reset(x, TObj(k: nkValue))' instead? why bother? '=' does the
same.
- returning 'var T' is unsafe and needs some static analysis
GC
==
- precise stack marking; embrace C++ code generation for that
- marker procs for Boehm GC
- hybrid GC
- GC: implement simple generational GC
* first version: mark black in write barrier
* second version: introduce fake roots instead of marking black
* third version: find some clever heuristic which is preferable
- acyclic vs prunable; introduce GC hints
- use big blocks in the allocator
- object pooling support for *hard* realtime systems
- provide tool/API to track leaks/object counts
- resizing of strings/sequences could take into account the memory that
is allocated
CGEN
====
- codegen should use "NIM_CAST" macro and respect aliasing rules for GCC
- ``restrict`` pragma + backend support
- 'const' objects including case objects
Not essential for 1.0.0
=======================
- allow implicit forward declarations of procs via a pragma (so that the
wrappers can deactivate it): better solution: introduce the notion of a
'proc section' that is similar to a type section.
- implement the "snoopResult" pragma; no, make a strutils with string append
semantics instead ...
- implement "closure tuple consists of a single 'ref'" optimization
- optimize method dispatchers
- ``with proc `+`(x, y: T): T`` for generic code
- new feature: ``distinct T with operations``
- arglist as a type (iterator chaining); variable length type lists for generics
- implement marker procs for message passing
- activate more thread tests
- implement closures that support nesting of *procs* > 1
- object constructors: static check for fields if discriminator is known at
compile time
- prove array accesses
Optimizations
=============
- optimize 'if' with a constant condition --> necessary in frontend for better
dead code elimination
- escape analysis for string/seq seems to be easy to do too;
even further write barrier specialization
- inlining of first class functions
- proc specialization in the code gen for write barrier specialization
- VM/optimizer: implement on the fly CSE