-
Notifications
You must be signed in to change notification settings - Fork 0
/
TODO
30 lines (30 loc) · 2.05 KB
/
TODO
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
1. Look at syntax error handling, https://gallium.inria.fr/~fpottier/menhir/manual.html#sec69
2. Setup some testing
3. Remake simple assembly compiler
4. Look into LSP
7. Fix variable modifiers, broken for const array index assignments
8. Reduce instruction set
- FieldAssign x, could be replaced by: PlaceInt (8*x); IntAdd; RefAssign.
9. Attempt true seplin-to-C transpilation
- Manually at first
11. More type inference
- Requires a monadic compiler (i.e. need the var_env to be available and returnable everywhere, manually as argument is tedious)
- Allow not specifying a type in simple declarations
- 'x: int;' becomes 'x;'
- Allow not specifying a type for routine arguments
- '(x : int) { x +:= 2; }' becomes '(x) { x +:= 2; }'
- Introduce a new polymorphic type, 'T_Poly of string', which will represent these missing types
- Carry a StringMap in 'var_env', in which specification of the polymorphics happen
12. Index References
- Should solve the quirk that fields and indices cannot be given as modifiable arguments
- Requires a new heap object type, increasing the number from 2 (struct/value).
- Which is a header, and a reference (either to the struct start or directly to the index)
- The head has the same data as usual, but the 'size' data refers to which index is being referenced
- This is needed such that freeing an index reference, can find the header of the struct and decrease its 'ref_count'
- Requires a new instruction, 'Indirect', to create these heaps objects
- Instructions operating on references will need a rework to handle these
- Should be something along the lines: "If the object is on the heap, and an indirect, dereference it once more"
- If 'x' is an index reference, and we write 'y := x', y should point to the same index reference object as 'x'.
13. Move AST optimization to its own compiler step, instead of being part of toProgramRep
14. Cleanup
- Try using the Option module functions more, instead of pattern-matching on options all the time