-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTODO.txt
executable file
·58 lines (42 loc) · 3.23 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
This is a temporary TODOs file for things that are to be done later on in the language.
This will (likely) be deleted once Zymux's development is mostly finished.
----------------------------------------------------------------------------------------------------
Allow backslashes at lexer to skip escapes (like skipping a newline before it happens).
Also, allow escaping actual escapes in strings?
Name the slash/backslash that seperates folders of imports "delimiter".
"nothing" keyword which assigns to nothing. Useful for throwaway assignments in multi-assignments.
Also, maybe can be used with "is" in order to mean an "empty" datatype
(like 0 for int, "" for strings, [] for lists, and {} for maps instead of null?).
Because every function in Zymux is created during compilation as a constant (and not runtime),
we can actually attach an integer "constIdx" to each function,
representing the index in the constant pool of a chunk they're on (perhaps -1 if <script>).
Then, after compilation we just iterate through the VM's FrameStack of functions,
and look at their constIdxs one by one to immediately head straight to the erroneous function.
Actually, the "constIdx" member can be part of the frame instead of the function,
and it gets set on whenever we append a function maybe?
This'll allow us to just find the function that errored directly instead of using its name
(which doesn't work as multiple functions at different scopes can have the same name).
Issue warnings for weird edge cases for the language. Example:
AST finding the expression condition of an if/while to be an assignment.
(Allow warnings to be disabled with a certain flag or something)
When importing a new module and setting a new VM temporarily, change the GC's vm to that VM until
it finishes executing the module, after that set it back to the older VM so the GC can work on its
objects. This should be fine to do if only one module can be creating/collecting objects at a time.
----------------------------------------------------------------------------------------------------
Optimization:
1. Heavily optimize memory usage in parser by traversing the AST for freeing nodes
instead of having a linked list. This saves the need for an 8 byte "next" pointer.
Potentially use an arena to avoid the linked list for objects too, as all objects
are in front of each other in the arena. Might also increase or even decrease performance?
Gotta benchmark it, though.
2. Optimize node memory for unary/binary nodes by storing their operation token as just
the source position and a token type enum value.
3. Change certain macros to use the normal type instead of pointer to optimize dereferencing.
(In other words, use the dot operator instead of the arrow).
----------------------------------------------------------------------------------------------------
Implement LAST_ITEM_DA() to more easily access the last element of a dynamic array.
Make it resolve to NULL if the array doesn't have any elements to begin with.
Test out the new DROP_AMOUNT_DA().
Potentionally name VM stack macros to have _VM() suffix to make what they modify clear.
Is manually protecting strings even a good thing? Because it seems it might be caught up
in a gc pop.