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