-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtodo.txt
69 lines (62 loc) · 3.45 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
Unimplemented & bugs
proper error message when 'fn main' is missing
integer division algorithm
machinecode_move bug (documented in code, I think. Easy to fix now too...)
'enum Foo(i64) { A = I64_MIN - 1 }', with the value as a literal, does not generate an error, because we have no way of detecting the underflow happening...
Other
a proper test-suite for the compiler
some static access errors still are obtuse
'GetCommandArgsA' and 'GetEnvironmentVariableA': Use widechar versions
use various registry calls etc. to get the location of windows libraries
Language features
c-style for loops, for e.g. link list iteration
comparing pointer as if they were integers (doable in C, and potentially usefull...)
complete type_info_of_{value, type}
slices
a 'any' type (void pointer + type info)
uninitialized (zeroed) global variables in .bss
unions
maybe a better parser for floats? The current one is pretty accurate for f32 at least though
casts from/to bool
flags enums
array bounds checking
static_assert
ignore spaces in identifier chains
intrinsics - then we could remove the sqrt() builtin
function overloading
default function parameter values
vararg functions
multiple return values
Compiler internals
strings as compile time exprs
just move 'context' into a global
reorder 'Typecheck_Item's to reduce passes in typechecker
don't generate jump at end of switch case of block in 'if' if we know the block will return for sure
stack unwinding - so we can produce a stack trace on e.g. assert
.pdata and unwind info
enabling subsystem windows (over subsystem console)
debug info
growing the stack? __chkstk
static libraries (currently we only support dynamic libraries) (Although both static and dynamic libraries have a .lib file on windows, I think explicitly stating whether we expect to load a file as static or dynamic in code is good, as it serves to avoid confusion)
can we toggle fp exceptions? Should we expose that?
Optimized code-gen
constant folding
common subexpression elimination
avoid using reference semantics for structs of sizes 3, 5, 6, and 7 (we don't for sizes 1, 2, 4 and 8)
sethi-ullman? (reordering the order in which we evaluate subexpressions for better register allocation)
at least prefer using non-volatile registers when a function call is comming up, so we don't have to store the contents
register allocation accross statement-boundaries
align functions to 32-bit boundaries, padding with nops (many compilers do this, do we have to though? also, why the padding with noops?)
peephole optimizations
Considerations for new code-gen
Common subexpression elimination - Should this be done in the codegen backend, or in the frontend?
Register allocation
Calls, jumps
Compound types, which wont fit in registers - Should the backend hide this
mul, div, shl and co., which have special register allocation considerations
large SSE registers
negated jumps - there are some complex cases related to floats
Linking
Do we want to specify where we expect the compiler to find libraries? "windows:kernel32.lib" vs "build\frontend.lib"
Allow linking dynamically without actually having the .lib file. Performance penalty because we don't get the load hint in the lib then?
Static linking - I can't imagine this is particularly hard, it just involves parsing lovely, lovely ms formats