1 # This is a living document - delete things when done. Avoid discussion.
3 ## Needs implementation
5 ### Current version (Cataract Creek)
8 - use AddressOf instead of AssignRef
9 - revise all commentary
13 ### Next Version (Govetts Creek)
14 - int nat cyc {i,n,c}{8,16,32,64} - maybe not cyc - it needs size.
15 - ops: # & | ~ &~ - no shift: use (N * #shift) or (N / #shift)
17 - enum, with multi-valued names. enum foo { yes, no, many(10) }
18 bar:foo=.yes; if bar == .no... if ?bar.many: print bar.many, "items"
19 Maybe .true and .false for Boolean
20 - change use/case labels to create a local enum if no type is evident.
21 - set, with bool or int members. set foo { pinned, memalloc, priority(4) }
22 bar:foo = .memalloc | .priority(2). if bar.pinned: bar.priority += 1
23 . array slices - references to arrays "foo: []bar"
24 - array access to read bytes from strings. How to get length? "?string[4]" ??
26 - remove all tests on type->functions
27 - use a type->function for performing function call
28 - revise all commentary
32 ### Subsequent version
33 - Maybe allow a reference to be passed to function where the by-value is expected
34 - 'return' statement similar to 'use', but only valid a function context
35 - 'return' can take no value when function has inline/transparent return value
36 - simple methods. Define "func type.name...." and the name will only be visible
37 within namespace for type.
38 - optional args for functions - if value given
39 - named args? Needs to look like manifest structs
40 - array args - last parameter can collect all remaining as array if attribute 'open'
41 do I need attribute? Can anything be type compatible with both X and []X ??
42 - initial values for return parameters
43 - convert between string and array-of-cyc8
45 - transparent fields, parameters which are structs or pointers
46 - transparent fields which are arrays
47 - transparent results from functions to have same effect as inline-results
48 - manifest values for records: [.foo = a, .bar = b]
49 - manifest values for arrays: [expr = expr, ...]
50 - constant structure definitions
51 - const structures can inherit from another, and update select fields.
52 - 'use' labels *must* appear in case statements.
53 - 'then' can extend a case section into some other.
56 - do I need a 'rune' type? What are the elements of a string?
57 Are they small strings? Can I convert to codepoint by treating as number?
58 How much of this is in the utf8 library? Can a string literal be a number?
59 - exactly where does auto enref/deref happen?
60 .foo modifier does auto-deref
61 (args) modifier does auto-deref (if that makes sense)
62 assignments does auto-enref
63 function parameter passing does auto enref and auto deref
65 general operators? Not comparison. Not test. Probably not anything.
67 - can "A if B else C" have "A" and "C" be different - one a ref and one not?
68 This might make sense if a ref was wanted - an lvalue is then accepted.
70 - ? modifier for type makes "no such value" an option, detected by '?' operator
71 - $ operator to convert to ?number from ... ref? enum?
72 ?$"hello" can test if the conversion would work. '$foo ?? default'
73 provides a default value
74 - a suffix on a number/string can provide soft typing which is interpreted
75 in type context. Must like .enumvalue is interpreted only the context of
76 expected type, '43i' would only be meaningful in the same context.
77 - const arrays that are initialized incrementally throughout the code,
78 and post-processed at compile-time, e.g. to sort or derive LR tables.
79 Maybe even across modules.
81 Maybe 'const' can be followed by name of a const which forms the namespace.
82 So a struct bar containing x and y could be initialized
85 Then an array could be extended with [+]
89 The syntax needs to be clearly different from
91 if that is still allowed
92 Maybe the '=' is enough to differentiate
94 - IN and OUT should not be completely ignored when not expected.
95 As well as causing NEWLINE to be ignored, there should be some
96 balance requirement. Some productions should be required to be
97 balanced. Lists should not have gratuitous indents.
98 Revisit everything I considered before, but now consider it only
101 - "debug" code that can be compiled out. For code, "if debug" is enough
102 if the const can be set easily. For structure members a 'debugonly'
103 attribute needs to be handled. Of course 'debug' is multifaceted.
104 We might want tracing, consistency, profiling, etc.
106 - union types - how do I want to support these? inheritance with variance?
108 - 'error' value for various types. NIL for pointer NaN for float, extra flag bit
109 for integers. -MAX_INT ??
110 - enum as array index. foo:[:enum]int. foo[.baz] = 23
112 - const fields in structs: like const, but in 'type' namespace, not 'module'
113 - 'borrowed' and 'owned' attributes for pointers. .free method
114 - interfaces - list of methods that must be defined
115 - standard interfaces to access operations: group, field, binary, logical
116 - modules - exported names in versions, and import lists
117 on types, fields, constants, etc
118 - foreach variable-list := make_generator() do
119 A generator has 'first', 'next' and 'finally' methods
120 'first' and 'next' return the same type which is conditional ('?' works)
121 'finally' returns some other type - possibly Tnone - which goes to
122 a set of case at end of loop
124 - attributes for fields and local variables
125 transparent - names inside can be accessed directly
127 handled - accesses convert to function calls??
128 constant - compile time constant - not stored
130 add-only - ?? like append-only.
131 read-only - set early never changed?
133 owned - Can be borrowed and freed
134 borrowed - There is somewhere this is borrowed from
136 pure - definitely not an error
137 endian(big,small,pdp)
138 attributes for whole struct
139 unsorted - fields appear as written
140 packed - like unsorted, but no gaps permitted.
142 - lambda functions for passing as arg to function.
143 Are these always there to provide an interface for a value?
144 Do I want a syntax for functions that just provides a value
145 func (a:number; b:string):number = a+b[]
148 - iso suffixes for number?
149 - static variables. Easy to implement, but need a syntax. Something
153 reference attributes for locks and refcounts etc
155 - do/go/run/fork/async complex statement
156 All local variables accessed in the body are read-only
157 and copied to a new frame, and code is run in a new thread.
158 Thread is mostly invisible. It interacts through shared objects,
159 particularly the caller might create a channel and the thread
160 might send messages on it. Any interesting handshakes
161 are mediated by appropriate data structures.
163 - arbitrary value asserts tied to variable attributes.
164 e.g. ranges for value and relationships between fields
165 These are tested by compiler at any changed. Somehow.
167 - expose parse info for editing by code run at compile time.
168 This allows new attributes to be implemented in app code.
169 E.g. handling bigendian fields by adding conversion functions.
171 - Finalize what a "main" program looks like.
172 should argv come from a library (sys.argv), or should environ go to main?
175 - constructors and destructors - or "after" ??
176 destructors, which can be declared inline
177 - vtables, fat pointers, list of approaches
178 - interfaces, inheritance
179 - closures, threads, co-routines, generators lamdas
180 - generics/templates. These should be just a compile-time
181 decision. Same code can be called with suitable methods passed, or
182 recompiled in the new context and then optimised.
183 - introspection / reflection ?
184 e.g. support serialization
185 find function given a string holding the name
186 measure coverage, adjust based on performance metrics
187 auto-create mock objects
188 Is this just parsing the details in the obj file?
190 - parameterised types, and dependant types
191 - message passing primitives
192 - overloading for numbers
194 - ensure list_head type concept can work
196 NO - pattern matching for destructuring??
197 - casts to and from "binary".
199 - ??? algebraic types
201 - code can appear in multiple forms:
203 - abstract syntax tree
205 - loadable machine code
206 - executable-only machine code
207 All but last can be loaded by 'ocean' and transformed into a later form,
208 or executed directly. byte-code and loadable machine code will likely
209 have ast content was well to describe types and provide template code.
212 - augmented and overloaded pointers
213 An augmented pointer can also store a flag- for a bitlock etc
214 An overloaded pointer can alternately store an int - e.g. error code
215 - garbage collection?
216 - UTF8 string disection
218 - cvt() interface an format() function
219 - parsing: rexep? LALR? sscan?
221 - auto-growing buffer including strings