This repository has been archived by the owner on Nov 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathTODO.txt
102 lines (84 loc) · 3.8 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
TODOs
~~~~~
Code:
-----
- More documentation ***Urgent***
- More testing ***Urgent***
- REFACTOR the VM! (dispatch_loop()'s cases into functions, in particular)
- Do it in a test-driven manner, since it's CRITICAL
- One instruction a time, exhaustive testing (cover ALL
code paths!), before AND after
- grep for "TODO", "FIXME" and "XXX" in the source files
- add variable names <-> register mapping to debug information
- expose rich debug info to JavaScript API
- smarter algorithm in `spn_dbg_get_raw_source_location()` (no linear search)
- add and interactive debugger function to the standard library
Language:
---------
* Syntax:
- only one syntax for 'for' loops (no parens) and functions
- What to do with `!`, `&&`, `||` vs. `not`, `and`, `or`?
('not' is superior to '!' for readability reasons, but
we don't want redundancy in the syntax.)
* Semantics:
- For-in loop on collections rather than C-style "init; condition; increment;" loop
- Permit variable declarations in the condition of 'if' and 'while' statements
- Allow mutation of upvalues of a closure
- Pattern matching, switch/match-case
- hoist function declarations to the top of the translation unit in order to
get rid of the awkwardness of self-referential class constructors?
(e.g. examples/complex.spn)
- Remove explicit type specifiers from format strings; just use %v like Go does
* XXX: what to do with C API calls to the string formatting functions?
They do need type info in the format string...
- Macros?
- multiple return values or tuples
- optimize chained concatenations (x .. y .. z .. foo .. bar .. quirk)
so that they aren't done in separate steps (as specified by the
associativity of the .. operator), because creating huge temp
strings in O(n ^ 2) is wasteful. Instead, these should be somehow
compiled into one great CONCAT_ALL(x, y, z, foo, bar, quirk)
instruction (this may need VM support)
- "operator overloading" of some sort... (on user-defined hashmap objects)
Compiler:
---------
- support for warnings?
- Issue a warning if a top-level expression (i. e. an expression statement)
is neither a function call, an assignment nor an increment/decrement
operation. Nothing else should be used as an expression statement,
really.
- Issue a warning when an assignment is used in the condition of an if,
while, do-while or for statement.
VM:
---
- Weak references for deallocating cyclic references
Standard library and other libs:
--------------------------------
- more and better string support
- Unicode support! proper string API (with grapheme clusters and stuff)
* also stop using strings as generic byte buffers
- Library: e.g. string replacement, pattern searching,
"has prefix/suffix?" operation, trim leading/trailing whitespace, ...
- C99 and POSIX-specific extension APIs (in addition to the "standard"
runtime support library)
- directory listing ("what files are in directory /X/Y?")
- permission (chmod) and user+group (chgroup) handling; + get[e]uid(),
set[e]uid(), ...
- better date/time support (date operations; an actual, useful
timer object; formatting and parsing)
- getopt (POSIX and C-style)
- process management, especially popen(), getpid(), ...
- thread support
- functional stuff that requires closure (a la Python's functools)
- 'require()' and 'dynld()' should search SPN_LIBDIR for modules
- Bindings for popular and useful C libraries for a variety of use cases, e.g.:
- cURL
- SQLite3
- a JSON parser/serializer done (YAJL)
- an XML parser/serializer
- SDL2 done
- Date/Time/Calendar support via the ICU library
- compression (zip, tar, gz, ...)
- PCRE (people apparently love regexes)
- a UI/widget library (e.g. GTK+)
- etc.