]> 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 - union types - how do I want to support these? inheritance with variance?
58 - lambda
59 - 'error' value for various types. NIL for pointer NaN for float, extra flag bit
60    for integers.  -MAX_INT ??
61 - enum as array index.  foo:[:enum]int.  foo[.baz] = 23
62 - init_only fields
63 - const fields in structs: like const, but in 'type' namespace, not 'module'
64 - 'borrowed' and 'owned' attributes for pointers.  .free method
65 - interfaces - list of methods that must be defined
66 - standard interfaces to access operations: group, field, binary, logical
67 - modules - exported names in versions, and import lists
68       on types, fields, constants, etc
69 - foreach variable-list := make_generator() do
70       A generator has 'first', 'next' and 'finally' methods
71       'first' and 'next' return the same type which is conditional ('?' works)
72       'finally' returns some other type - possibly Tnone - which goes to
73       a set of case at end of loop
74
75 - attributes for fields and local variables
76     transparent - names inside can be accessed directly
77     
78     handled    - accesses convert to function calls??
79     constant   - compile time constant - not stored
80     stable     - ??
81     add-only   - ?? like append-only.
82     read-only  - set early never changed?
83     mutable
84     owned      - Can be borrowed and freed
85     borrowed   - There is somewhere this is borrowed from
86     dependant  - ???
87     pure       - definitely not an error
88     endian(big,small,pdp)
89   attributes for whole struct
90     unsorted   - fields appear as written
91     packed     - like unsorted, but no gaps permitted.
92
93 - lambda functions for passing as arg to function.
94    Are these always there to provide an interface for a value?
95    Do I want a syntax for functions that just provides a value
96      func (a:number; b:string):number = a+b[]
97    
98 - units for numbers
99 - iso suffixes for number?
100 - static variables.  Easy to implement, but need a syntax.  Something
101   really loud.
102 - concurrency
103       implicit and explict
104       reference attributes for locks and refcounts etc
105       RCU
106   - do/go/run/fork/async complex statement
107      All local variables accessed in the body are read-only
108      and copied to a new frame, and code is run in a new thread.
109      Thread is mostly invisible.  It interacts through shared objects,
110      particularly the caller might create a channel and the thread
111      might send messages on it.  Any interesting handshakes
112      are mediated by appropriate data structures.
113
114 - arbitrary value asserts tied to variable attributes.
115   e.g. ranges for value and relationships between fields
116   These are tested by compiler at any changed.  Somehow.
117
118 - expose parse info for editing by code run at compile time.
119   This allows new attributes to be implemented in app code.
120   E.g. handling bigendian fields by adding conversion functions.
121
122 - Finalize what a "main" program looks like.
123    should argv come from a library (sys.argv), or should environ go to main?
124
125 - classes
126    - constructors and destructors - or "after" ??
127      destructors, which can be declared inline
128    - vtables, fat pointers, list of approaches
129 - interfaces, inheritance
130 - closures, threads, co-routines, generators lamdas
131 - generics/templates.  These should be just a compile-time
132   decision.  Same code can be called with suitable methods passed, or
133   recompiled in the new context and then optimised.
134 - introspection / reflection ?
135       e.g. support serialization
136       find function given a string holding the name
137       measure coverage, adjust based on performance metrics
138       auto-create mock objects
139       Is this just parsing the details in the obj file?
140 - FFI
141 - parameterised types, and dependant types
142 - message passing primitives
143 - overloading for numbers
144 - exceptions ??
145 - ensure list_head type concept can work
146 - "union" type ??
147 NO - pattern matching for destructuring??
148 - casts to and from "binary".
149 NO- typeswitch?
150 - ??? algebraic types
151
152 ## Needed in library
153  - augmented and overloaded pointers
154     An augmented pointer can also store a flag- for a bitlock etc
155     An overloaded pointer can alternately store an int - e.g. error code
156  - garbage collection?
157  - UTF8 string disection
158  - search, regexp
159  - cvt() interface an format() function
160  - parsing: rexep? LALR? sscan?
161  - buffered file IO
162  - auto-growing buffer including strings
163  - sockets
164  - http
165  - html
166  - gtk? xcb?
167