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