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