/
todo.txt
138 lines (96 loc) · 6.04 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
# LANGUAGE TODO
instanceof operator, like "42 isa Number" and "42 isa Int", including for the new tlUserClass
change and update "match" syntax, no more { ... }: instead something like "match x: 10 -> something ...\n 20 -> something ..."
think about "if x = findSomeX(): print x", instead of "x = findSomeX(); if x: print x"
switch "Object.each({key=value}): k, v, n -> ..." to ": v, k, n ->" to be inline with "[1, 2, 3].each: v, n -> ..."
add "[1,2,3].get(4, or="not there")" or something like that
think about array access as list(1) instead of list[1]?? and then list(1) = 10? map("foo") = 10, Object.set(object, "foo") = 10
implement default values, "near = in, value, range=3 -> ... "
implement 3 way comparison: "value - range <= in <= value + range"
pretty print very pretty: do classes nicely, like Vector{x=1, y=1, z=1}, cut off long things
have two kinds of bytecodes: scripts and modules, scripts behave like functions, modules behave like classes
perhaps add annotations, such that you can ask "function.annotations.foobar", might be used to do exports, setters, public/private?
# IMPLEMENTATION TODO
make tlInt and hahsing (uint32_t) work together, simply fix the high byte to 0?
unify tl_kind with tlClass with tlUserClass allow to inherit from host native objects
implement real operators, finally
tlSet (set.c) is not really any good, it is a SymbolSet and should be treated as such
add intern() to tlSet? just like symbols, would be amazing for classes and objects
fix/finish modules, should load them relative to current module, then Task.locals, then TL_MODULE_PATH; should be able to call them as functions, as well as get their results
allow tlEnv to have imports, so that before mod->links[global] we look up global against all scoped imports first
add tlClass with mixins and super and fields and methods, all primitives should have a tlClass
implement proper operators and "hello" is String stuff
add import to env
add way to extend objects within the current scope
optimize code->argspec
optimize code->hasLazy
perhaps add args->names.last as object that maps symbol to args->names index
add inline caches for all lookups, like tlCode->hashes[x] could be an entry, and simply count all CALL opcodes
add something for 'collection["key", otherwise]' but will be part of get interface then
think about shared locks, so whole slew of items share single lock, especially helpful for Mutable objects
think about {call:42} meaning something different from {foo:42} and perhaps remove that "meaning" by only making call special if "object" with a "class"
implement a true class based object, vs value objects, vs maps
undefined collect stack traces, while it doesn't work as advertised ... either enhance or dumb down
tool gcov and assure make test has full coverage
work on documentation
add optional types turning into asserts, experiment with compiler discovering types
null > 1: throw undefined? or return undefined?
graphics: turn into module, by registering a vm exit function and moving vm to alternative thread
graphics: don't do the thread/blocking/reentrance dance, instead, have a single task driving native API
bytecode
- in bytecode, we don't need argnames, we can calculate and store that map when we need it, als we can size the args list dynamically, saves space ...
- implement classes in parser, compiler
- ensure debugger works
- have a coverage tool
guarded expressions: think about a better syntax?
add "if"/"unless" to parser to do
- return if true
- return unless true
- if(true,something,otherwise)
do we want a true else? or just use guarded expressions?
add xml like things to language
add a WeakMap, add a HashMap based on regular locked hashmap implementation
add kind->resume for tlFrame and throw using frame.kind.name
do class._name for error.toString: this.class._name ": " this.msg ...
on error, if object, call toString on it ...
implement a_var based on libatomic_ops ...
implement print in user code, or have it call toString properly ...
do errors with nice backtraces per file etc, and per task ...
add a "static" layer, where the symbol table, gc, and mainloops+locks live
allow multiple vm's per loop, and muliple loops per vm (io and gui loops...) handle when to exit...
what about close() and stat(); they might still block or eintr ... do them on yet another thread?
bug: tlCallableIs does not know complex user objects, just try and catch not callable?
do private using $: { public: 42, $private: -1 } accessed just by $private ...
use * for vars; like this: x = var 0; *x += 1 ... add .increment/decrement and such to var
instead of hotel, lets call it arrows? .rr? .arrow? sounds nice
start preparing a first release:
* stamp every file with license/author
* use gcov to remove any unused code or add tests for them (larger parts...)
think about special inherited task local *Env*:
* for stdin/stdout/stderr
* for cwd
* for module resolving path
* for error mode (report on stdout or throw on waiter/value)
module lookup: should be in a task, should try sender path, then all module paths
but module lookup should not be automatic but maybe sys.io.chdir
add send as code primitive: target, msg, args, instead of _object_send
add op as code primitive: op, lhs, rhs
add methods vs functions, methods try to bind a this dynamically ... helps with actors too
example: function = ( -> ); method = ( @, -> )
implement `Point = { recurse: Point }` for as far as we can? do Point lazily?
add default arguments using print = (sep=" ", end="\n")->{...} etc ...
implement collector: x, *rest = multiple_return()
implement splay: return(a1, a2, *list) by return.call(a1 :: a2 :: list)
implement lvalue assignment: mutable.field = fn()
implement defer (add defer[] to tlCodeRun) or something ...
optimize: remove tlHead in favor of just a tlClass ... use last 3 bits as flags
optimize: tlFrame can use 3 bits from resumecb too ...
# missing
operators (well, the real ones)
classes (well, syntax for them and super and such ...)
class loaders for overriding/extending known classes
lazy evaluation (call by need)
finalizers
default arguments
splays on either side
complex lhs assigns