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