forked from toddjasonblackmon/wren
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTODO
73 lines (51 loc) · 2.42 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
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
TODO - Darius's original (2008) list
Key to column 1:
X - done
N - won't do it
? - dunno what Darius meant
X basic interface to the hosting C program
X (with wren_ prefixes & header file)
better error reporting and recovery
warn when memory gets low
optional preloaded standard library
(not in RAM -- I suppose we'd interpret the high bit of our 16-bit
pointers as indicating it's in ROM space)
write a bigger example, something vaguely useful
fix remaining XXXs
tauten and clean up the code
N optionally compile VM code into flash (I guess this'd obviate the
N separate ROM addressing, above)
X make it easier to add/remove primitives -- added CCALL
improve safety in the face of pokes
? measure size of VM-compiled programs -- maybe Todd's "Nice little header" at end of boot.wren suffices?
make VM encoding a bit more compact (the easy stuff)
check for keyboard interrupt (or equivalent)
basic debugging support
* backtrace, at least
* 'panic' primitive
* decompiler?
X do something about (-1) as a literal? (parens ugly) - DONE - If last instruction is push, just negate.
make 'else' clause optional?
require some end-of-function delimiter to reduce scope for ambiguity?
(especially the treatment of newlines)
a cleverer VM encoding vaguely along the lines of 'Little Smalltalk':
* 4-bit split (opcode-family, parameter)
* two 'misc' families with the opcode in the parameter part
* extended-parameter families
(with 4-bit family code followed by 1- or 2-byte parameter value)
* the obvious families like PUSH, FETCH_LOCAL, BRANCH, JUMP
* the remaining space can go to combined superinstructions
(interpreted from a 16-byte table for each such family; the
peephole optimizer uses the same tables)
along with:
a 2-pass compiler, comprising:
* parse and generate intermediate code forwards
(intermediate code is pretty much like the current simple instruction
set, but designed to be read only from the end backwards)
* peephole-optimize backwards, converting to actual VM code
* (and finally, memmove() the VM code into place; it will have shrunk)
a self-hosted compiler, to take advantage of the above
(it should be smaller overall than the C-compiled compiler)
syntax extensible at runtime, using the above
closures allocated into the dictionary, a la Forth's CREATE DOES>
nested 'let' and 'fun'