]> 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 - allow type names to be used before declared.  Need to re-evaluate all
8   type sizes after parse.
9 - resolve the HACK of allowing assign from struct when name starts space.
10 - '?' prefix operator returns Boolean, index operator for strings. Can be used to
11    test for end-of-string
12 - ?? infix operator return LHS if '?' on it would succeed, else RHS
13 - reference to struct or intrinsic (@foo), with @new, @free, @nil and ? to test
14 - add [] as size-of-array
15 - replace [foo::] declaration of array with [] - fix all main() calls
16
17 ### Next Version (Govetts Creek)
18 - int nat cyc {i,n,c}{8,16,32,64} - maybe not cyc - it needs size.
19 - ops: # & | ~ &~  - no shift: use (N * #shift) or (N / #shift)
20 - op=
21 - enum, with multi-valued names.  enum foo { yes, no, many(10) }
22   bar:foo=.yes; if bar == .no... if ?bar.many: print bar.many, "items"
23   Maybe .true and .false for Boolean
24 - change use/case labels in ".name" which creates a local enum if no
25   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 - allow global names to be used before they are declared.  Assume global
29    if undeclared, and complain in final analysis.
30 . array slices - references to arrays
31 - array access to read bytes from strings.  How to get length?  "?string[4]" ??
32         array[] gets length??
33
34 ### Subsequent version
35 - 'return' statement similar to 'use', but only valid a function context
36 - 'return' can take no value when function has inline/transparent return value
37 - simple methods.  Define "func type.name...." and the name will only be visible
38   within namespace for type.
39 - optional args for functions - if value given
40 - named args?  Needs to look like manifest structs
41 - array args - last parameter can collect all remaining as array if attribute 'open'
42    do I need attribute?  Can anything be type compatible with both X and []X ??
43 - initial values for return parameters
44 - convert between string and array-of-cyc8
45 - float64 float32
46 - transparent fields, parameters which are structs or pointers
47 - transparent fields which are arrays
48 - transparent results from functions to have same effect as inline-results
49 - manifest values for records: [.foo = a, .bar = b]
50 - manifest values for arrays: [expr = expr, ...]
51 - constant structure definitions
52 - const structures can inherit from another, and update select fields.
53 - 'use' labels *must* appear in case statements.
54 - 'then' can extend a case section into some other.
55   
56 ## Needs Design
57 - const arrays that are initialized incrementally throughout the code,
58   and post-processed at compile-time, e.g. to sort or derive LR tables.
59   Maybe even across modules.
60   Need a syntax
61 - union types - how do I want to support these? inheritance with variance?
62 - lambda
63 - 'error' value for various types. NIL for pointer NaN for float, extra flag bit
64    for integers.  -MAX_INT ??
65 - enum as array index.  foo:[:enum]int.  foo[.baz] = 23
66 - init_only fields
67 - const fields in structs: like const, but in 'type' namespace, not 'module'
68 - 'borrowed' and 'owned' attributes for pointers.  .free method
69 - interfaces - list of methods that must be defined
70 - standard interfaces to access operations: group, field, binary, logical
71 - modules - exported names in versions, and import lists
72       on types, fields, constants, etc
73 - foreach variable-list := make_generator() do
74       A generator has 'first', 'next' and 'finally' methods
75       'first' and 'next' return the same type which is conditional ('?' works)
76       'finally' returns some other type - possibly Tnone - which goes to
77       a set of case at end of loop
78
79 - attributes for fields and local variables
80     transparent - names inside can be accessed directly
81     
82     handled    - accesses convert to function calls??
83     constant   - compile time constant - not stored
84     stable     - ??
85     add-only   - ?? like append-only.
86     read-only  - set early never changed?
87     mutable
88     owned      - Can be borrowed and freed
89     borrowed   - There is somewhere this is borrowed from
90     dependant  - ???
91     pure       - definitely not an error
92     endian(big,small,pdp)
93   attributes for whole struct
94     unsorted   - fields appear as written
95     packed     - like unsorted, but no gaps permitted.
96
97 - lambda functions for passing as arg to function.
98    Are these always there to provide an interface for a value?
99    Do I want a syntax for functions that just provides a value
100      func (a:number; b:string):number = a+b[]
101    
102 - units for numbers
103 - iso suffixes for number?
104 - static variables.  Easy to implement, but need a syntax.  Something
105   really loud.
106 - concurrency
107       implicit and explict
108       reference attributes for locks and refcounts etc
109       RCU
110   - do/go/run/fork/async complex statement
111      All local variables accessed in the body are read-only
112      and copied to a new frame, and code is run in a new thread.
113      Thread is mostly invisible.  It interacts through shared objects,
114      particularly the caller might create a channel and the thread
115      might send messages on it.  Any interesting handshakes
116      are mediated by appropriate data structures.
117
118 - arbitrary value asserts tied to variable attributes.
119   e.g. ranges for value and relationships between fields
120   These are tested by compiler at any changed.  Somehow.
121
122 - expose parse info for editing by code run at compile time.
123   This allows new attributes to be implemented in app code.
124   E.g. handling bigendian fields by adding conversion functions.
125
126 - Finalize what a "main" program looks like.
127    should argv come from a library (sys.argv), or should environ go to main?
128
129 - classes
130    - constructors and destructors - or "after" ??
131      destructors, which can be declared inline
132    - vtables, fat pointers, list of approaches
133 - interfaces, inheritance
134 - closures, threads, co-routines, generators lamdas
135 - generics/templates.  These should be just a compile-time
136   decision.  Same code can be called with suitable methods passed, or
137   recompiled in the new context and then optimised.
138 - introspection / reflection ?
139       e.g. support serialization
140       find function given a string holding the name
141       measure coverage, adjust based on performance metrics
142       auto-create mock objects
143       Is this just parsing the details in the obj file?
144 - FFI
145 - parameterised types, and dependant types
146 - message passing primitives
147 - overloading for numbers
148 - exceptions ??
149 - ensure list_head type concept can work
150 - "union" type ??
151 NO - pattern matching for destructuring??
152 - casts to and from "binary".
153 NO- typeswitch?
154 - ??? algebraic types
155
156 ## Needed in library
157  - augmented and overloaded pointers
158     An augmented pointer can also store a flag- for a bitlock etc
159     An overloaded pointer can alternately store an int - e.g. error code
160  - garbage collection?
161  - UTF8 string disection
162  - search, regexp
163  - cvt() interface an format() function
164  - parsing: rexep? LALR? sscan?
165  - buffered file IO
166  - auto-growing buffer including strings
167  - sockets
168  - http
169  - html
170  - gtk? xcb?
171