]> git.xonotic.org Git - xonotic/gmqcc.git/blob - TODO
Handle double negation case specially. Update TODO
[xonotic/gmqcc.git] / TODO
1 GMQCC is quite feature complete.  But that doesn't address the fact that
2 it can be improved.  This is a list of things that we'd like to support
3 in the distant future.  When the time comes, we can just select a topic
4 from here and open a ticket for it on the issue tracker.  But for the
5 meantime, this is sort of a cultivating flat file database.
6
7 Optimizations:
8     The following are optimizations that can be implemented after the
9     transformation into static-single assignment (SSA).
10
11         Global Value Numbering:
12             Eliminate redundancy by constructing a value graph of the source
13             then determining which values are computed by equivalent expressions.
14             Similar to Common Subexpression Elimination (CSE), however expressions
15             are determined via underlying equivalence, opposed to lexically identical
16             expressions (CSE).
17
18         Spare Conditional Constant Propagation:
19             Simultaneously remove dead code and propagates constants. This is
20             not the same as individual dead code elimination and constant propagation
21             passes.  This is multipass.
22
23     The following are optimizations that can be implemented before the
24     transformation into a binary (code generator).
25
26         Code factoring:
27             The process of finding sequences of code that are identical,
28             or can be parameterized or reordered to be identical.
29             Which can be replaced with calls to a shared subroutine. To
30             reduce duplicated code. (Size optimization)
31
32 Language Features:
33     The following are language features that we'd like to see implemented in the
34     future.
35
36     AST Macros:
37         Macros with sanity.  Not textual substiution.
38
39     Classes:
40         Like C++, but minus the stupidity:
41             - No type operator overloads
42             - Keep operator overloading for basic operators though.
43             - No inheritance
44             - No virtuals / pure virtuals
45             - Essentially "C structs but with operators" :)
46
47     Arrays:
48         They're currently implemented, but support in the engine
49         plus implicit bounds checks (and ability to turn the bounds
50         checking off)
51
52     Exceptions:
53         I feel like all languages suck at implementing this.  This would
54         require support from the engine, but it would help catch bugs. We
55         could make it fast using a neat method of "frame pointers".
56
57     Overloaded Functions:
58         Ability to make individual functions with the same name, but take
59         different amount of arguments or type of arguments.
60
61     Default Argument Substiution:
62         Ability to specify default values for arguments in functions.
63         void foo(string bar, string baz="default");
64         Supplying just one argument will expand the second argument to
65         become "default", otherwise if two arguments are specified then
66         the "default" string is overrode with what ever the user passes.
67
68     Character Type:
69         A char type would be nice to have.  Essentially implemented as a
70         string, we can both "get" and "set" indices inside strings with
71         the help of builtin functions.
72
73         {
74             string foo = "test";
75             foo[0] = 'r';
76
77             print("it's time to ", foo);
78         }
79
80     Array Accessor With C-Semantics:
81         Also the ability to use them as array accessors:
82
83         {
84             float hugearray['Z'];
85
86             hugearray['a'] = 100.0f;
87         }
88
89         Keep existing "pointer-like" semantics as well.  In C arrays
90         simple work as pointers, a[1] -> *(a+1), or 1[a] -> *(1+a)
91         so we should allow both forms of syntax.  As well as operand
92         reversal.
93
94         {
95             float h['Z'];
96             *(h+'a') = 100;
97             *('a'+h) = 'a'[h];
98         }
99
100     FTEQCC Inline Assembly:
101         This is still up for debate, mainly because a) it's syntax is
102         just utter crap. b) If we do an assembler, it should be nice.
103         we could provide a -std=fteqcc for the assembler itself :P
104         just like the compiler; although I think that's just insane.
105
106         Please see Assembler below.
107
108     Namespaces:
109         There is already a ticket open on this. They'd work just like C++
110         identically even.
111
112 Standalone QCVM:
113     The following are QCVM additions:
114
115         Proper ASM disassembly:
116             Proper disassembly of compiled .dat files. Annotated if possible
117             when -g (is used during compilation)
118
119         Debugging:
120             A step-through debugger -d (with separate compilation as well)
121             Called -> qcdb  Optionally alias to qcvm -d :)
122
123             We should be able to see the assembly and source it matches to
124             and the state of OFS_* and calls.
125
126 Testsuite:
127     The following are things we'd like to see added to the testsuite
128     in the distant future:
129
130     Multithreading:
131         Chances are when we start adding more and more tests, executing
132         them individually will be midly slow (even if that's a whole minute)
133         It would be nice to add a -j paramater to allow multiple threads to
134         be used and so we can execute many tests in parallel.
135
136     Interface:
137         Ability to select individual tests, or set parameters manually
138         opposed to using the static task-template files. (A method to
139         override them rather).
140
141
142 Assembler:
143     Possibly support for a future assembler for QCASM.  But we're not
144     entirely sure if it makes sense.