]> ocean-lang.org Git - ocean-D/blob - 00-TODO
updates
[ocean-D] / 00-TODO
1 # This is a living document - delete things when done.  Avoid discussion.
2
3 ## Needs implementation
4
5 ### Current version (Cataract Creek)
6
7 - allow passing objects to functions by reference is requested
8 - add [] as size-of-array
9 - replace [foo::] declaration of array with [] - fix all main() calls
10 - ensure all param passing and value return is handled correctly
11 - remove all UNTESTED
12 - revise all commentary
13 - blog post
14 - release
15
16 ### Next Version (Govetts Creek)
17 - int nat cyc {i,n,c}{8,16,32,64} - maybe not cyc - it needs size.
18 - ops: # & | ~ &~  - no shift: use (N * #shift) or (N / #shift)
19 - op=
20 - enum, with multi-valued names.  enum foo { yes, no, many(10) }
21   bar:foo=.yes; if bar == .no... if ?bar.many: print bar.many, "items"
22   Maybe .true and .false for Boolean
23 - change use/case labels to create a local enum if no type is evident.
24 - set, with bool or int members.  set foo { pinned, memalloc, priority(4) }
25   bar:foo = .memalloc | .priority(2). if bar.pinned: bar.priority += 1
26 . array slices - references to arrays  "foo: []bar"
27 - array access to read bytes from strings.  How to get length?  "?string[4]" ??
28         array[] gets length??
29 - revise all commentary
30 - blog post
31 - release
32
33 ### Subsequent version
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
44 - float64 float32
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.
54
55 ## Needs Design
56 - exactly where does auto enref/deref happen?
57     .foo modifier does auto-deref
58     (args) modifier does auto-deref (if that makes sense)
59     assignments does auto-enref
60     function parameter passing does auto enref and auto deref
61
62     general operators?  Not comparison.  Not test.  Probably not anything.
63
64 - can "A if B else C" have "A" and "C" be different - one a ref and one not?
65   This might make sense if a ref was wanted - an lvalue is then accepted.
66
67 - ? modifier for type makes "no such value" an option, detected by '?' operator
68 - $ operator to convert to ?number from ... ref? enum?
69   ?$"hello" can test if the conversion would work. '$foo ?? default'
70   provides a default value
71 - a suffix on a number/string can provide soft typing which is interpreted
72   in type context.  Must like .enumvalue is interpreted only the context of
73   expected type, '43i' would only be meaningful in the same context.
74 - const arrays that are initialized incrementally throughout the code,
75   and post-processed at compile-time, e.g. to sort or derive LR tables.
76   Maybe even across modules.
77   Need a syntax
78   Maybe 'const' can be followed by name of a const which forms the namespace.
79   So a struct bar containing x and y could be initialized
80    const foo::bar
81        x ::= 1; y::=2
82   Then an array could be extended with [+]
83     const ra[+]
84         x::=2 ...
85
86   The syntax needs to be clearly different from
87      const a::num=1; b::=2
88   if that is still allowed
89   Maybe the '=' is enough to differentiate
90
91 - IN and OUT should not be completely ignored when not expected.
92   As well as causing NEWLINE to be ignored, there should be some
93   balance requirement.  Some productions should be required to be
94   balanced.  Lists should not have gratuitous indents.
95   Revisit everything I considered before, but now consider it only
96   for ignore IN/OUT.
97
98 - "debug" code that can be compiled out.  For code, "if debug" is enough
99   if the const can be set easily.  For structure members a 'debugonly'
100   attribute needs to be handled.  Of course 'debug' is multifaceted.
101   We might want tracing, consistency, profiling, etc.
102
103 - union types - how do I want to support these? inheritance with variance?
104 - lambda
105 - 'error' value for various types. NIL for pointer NaN for float, extra flag bit
106    for integers.  -MAX_INT ??
107 - enum as array index.  foo:[:enum]int.  foo[.baz] = 23
108 - init_only fields
109 - const fields in structs: like const, but in 'type' namespace, not 'module'
110 - 'borrowed' and 'owned' attributes for pointers.  .free method
111 - interfaces - list of methods that must be defined
112 - standard interfaces to access operations: group, field, binary, logical
113 - modules - exported names in versions, and import lists
114       on types, fields, constants, etc
115 - foreach variable-list := make_generator() do
116       A generator has 'first', 'next' and 'finally' methods
117       'first' and 'next' return the same type which is conditional ('?' works)
118       'finally' returns some other type - possibly Tnone - which goes to
119       a set of case at end of loop
120
121 - attributes for fields and local variables
122     transparent - names inside can be accessed directly
123
124     handled    - accesses convert to function calls??
125     constant   - compile time constant - not stored
126     stable     - ??
127     add-only   - ?? like append-only.
128     read-only  - set early never changed?
129     mutable
130     owned      - Can be borrowed and freed
131     borrowed   - There is somewhere this is borrowed from
132     dependant  - ???
133     pure       - definitely not an error
134     endian(big,small,pdp)
135   attributes for whole struct
136     unsorted   - fields appear as written
137     packed     - like unsorted, but no gaps permitted.
138
139 - lambda functions for passing as arg to function.
140    Are these always there to provide an interface for a value?
141    Do I want a syntax for functions that just provides a value
142      func (a:number; b:string):number = a+b[]
143
144 - units for numbers
145 - iso suffixes for number?
146 - static variables.  Easy to implement, but need a syntax.  Something
147   really loud.
148 - concurrency
149       implicit and explict
150       reference attributes for locks and refcounts etc
151       RCU
152   - do/go/run/fork/async complex statement
153      All local variables accessed in the body are read-only
154      and copied to a new frame, and code is run in a new thread.
155      Thread is mostly invisible.  It interacts through shared objects,
156      particularly the caller might create a channel and the thread
157      might send messages on it.  Any interesting handshakes
158      are mediated by appropriate data structures.
159
160 - arbitrary value asserts tied to variable attributes.
161   e.g. ranges for value and relationships between fields
162   These are tested by compiler at any changed.  Somehow.
163
164 - expose parse info for editing by code run at compile time.
165   This allows new attributes to be implemented in app code.
166   E.g. handling bigendian fields by adding conversion functions.
167
168 - Finalize what a "main" program looks like.
169    should argv come from a library (sys.argv), or should environ go to main?
170
171 - classes
172    - constructors and destructors - or "after" ??
173      destructors, which can be declared inline
174    - vtables, fat pointers, list of approaches
175 - interfaces, inheritance
176 - closures, threads, co-routines, generators lamdas
177 - generics/templates.  These should be just a compile-time
178   decision.  Same code can be called with suitable methods passed, or
179   recompiled in the new context and then optimised.
180 - introspection / reflection ?
181       e.g. support serialization
182       find function given a string holding the name
183       measure coverage, adjust based on performance metrics
184       auto-create mock objects
185       Is this just parsing the details in the obj file?
186 - FFI
187 - parameterised types, and dependant types
188 - message passing primitives
189 - overloading for numbers
190 - exceptions ??
191 - ensure list_head type concept can work
192 - "union" type ??
193 NO - pattern matching for destructuring??
194 - casts to and from "binary".
195 NO- typeswitch?
196 - ??? algebraic types
197
198 - code can appear in multiple forms:
199    - source code
200    - abstract syntax tree
201    - byte-code
202    - loadable machine code
203    - executable-only machine code
204   All but last can be loaded by 'ocean' and transformed into a later form,
205   or executed directly.  byte-code and loadable machine code will likely 
206   have ast content was well to describe types and provide template code.
207
208 ## Needed in library
209  - augmented and overloaded pointers
210     An augmented pointer can also store a flag- for a bitlock etc
211     An overloaded pointer can alternately store an int - e.g. error code
212  - garbage collection?
213  - UTF8 string disection
214  - search, regexp
215  - cvt() interface an format() function
216  - parsing: rexep? LALR? sscan?
217  - buffered file IO
218  - auto-growing buffer including strings
219  - sockets
220  - http
221  - html
222  - gtk? xcb?
223