]> ocean-lang.org Git - ocean-D/blob - 00-TODO
eafc4eec4ee1e890d3ffa76b96bc377e707bdc1f
[ocean-D] / 00-TODO
1 This is a living document - delete things when done.  Avoid discussion.
2
3 Current version (Cataract Creek)
4 - _interp_exec() to accept a value*, and type, and only copy large value there.
5 - functions to return struct with name assignment - bare 'use'?
6     struct is open-coded in header.  Later a similar effect
7     could be achieved with a named struct marked 'transparent'
8 - '?' prefix operator returns Boolean, index operator for strings. Can be used to
9    test for end-of-string
10 - ?? infix operator return LHS if '?' on it would succeed, else RHS
11 - reference to struct (@foo), with @new, @free, @nil and ? to test
12
13 Next Version (Govetts Cree)
14 - int nat cyc {i,n,c}{8,16,32,64}
15 - # & | ~ &~  - no shift: use (N * #shift) or (N / #shift)
16 - op=
17 - enum, with multi-valued names.  enum foo { yes, no, many(10) }
18   bar:foo=.yes; if bar == .no... if ?bar.many: print bar.many, "items"
19 - set, with bool or int members.  set foo { pinned, memalloc, priority(4) }
20   bar:foo = .memalloc | .priority(2). if bar.pinned: bar.priority += 1
21
22 Subsequent version
23 - simple methods.  Define "func type.name...." and the name will only be visible
24   within namespace for type.
25 - array access to read bytes from strings.  How to get length?  "?string[4]" ??
26 - optional args for functions - if value given
27 - named args?  Needs to look like manifest structs
28 - array args - last parameter can collect all remaining as array.
29
30 And then
31 - float64 float32
32 - enum as array index.  foo:[:enum]int.  foo[.baz] = 23
33
34 Later
35 - string manipulation
36 - structs
37    - const fields ... what does that mean?  Assign once as initialization?
38       Can be used for array size? What else?
39       'const' is wrong word.
40       I want 'const' for record to be type-wide constants, like enum.  I think
41       These would become read-only.  Maybe "init_only"
42    - anonymous field - array or struct (or pointer to these)
43       multiple anon struct are allowed if they don't conflict
44       no - transparent fields!  They still have a name, but you can
45       look through it.
46    - [] can apply to transparent array field
47    - transparent struct field gets fields interpolated
48
49    - How to give attributes? just say the word?
50         struct foobar:
51                 x:content  transparent
52                 size:number
53
54 - static variables.  Easy to implement, but need a syntax.  Something
55   really loud.
56
57 - manifest values for arrays and structs [a,b,c]
58     or [.foo=a, .bar=b] or [ [1]=a, [2]=b]
59    That last doesn't parse easily, unless we require tags... not a good idea.
60    [ .[1] = a, .[2] = b ] ?? Maybe.
61    or () to group, [] for index. To (.foo=a) ( [1] = b )
62
63    I think that last works. () might almost be optional
64      .foo=a
65    is an expression means a structure with a .foo field assined to 'a'
66      [3] = 2
67    is an array of at least 4 elements with 4th set to 2.
68   Or: an expression that starts '[' is a manifest struct or array.
69    It contains ',' separate list of assignments.
70    Each is either ".name = expr" for struct or "expr = expr" for array
71    Except that would prevent array with enum index.  Is that a problem?
72
73
74 - pointers
75    - owned or borrowed
76    - pure, loaded, overloaded, augmented
77    - owned: once, counted, collected
78    - shared or thread-local
79 - array slice
80 - array buffer - can be added to and grows.
81
82 - allow "do stuff" as a stand-alone statement (scope)
83 - 'use' labels *must* appear in case statements.
84 - 'then' can extend a case section into some other.
85
86 - expose parse info for editing by code run at compile time.
87   This allows new attributes to be implemented in app code.
88   E.g. handling bigendian fields by adding conversion functions.
89
90 Next version (Govetts Creek):
91 - functions and procedures
92 - Finalize what a "main" program looks like.
93
94 Much later
95 - per-field attributes
96     constant, stable, add-only, read-only, mutable, owned, borrowed, dependant, pure
97 - records
98 - enum / set
99 - classes
100    - constructors and destructors - or "after" ??
101      destructors, which can be declared inline
102    - vtables, fat pointers, list of approaches
103 - operators as interface methods
104      + - * / etc make an arith interface add sub mult div
105 - interfaces, inheritance
106 - modules, imports and exports
107      public(version) on types, fields etc
108 - closures, threads, co-routines, generators lamdas
109 - generics/templates.  These should be just a compile-time
110   decision.  Same code can be called with suitable methods passed, or
111   recompiled in the new context and then optimised.
112 - introspection / reflection ?
113       e.g. support serialization
114       find function given a string holding the name
115       measure coverage, adjust based on performance metrics
116       auto-create mock objects
117       Is this just parsing the details in the obj file?
118 - FFI
119 - parameterised types, and dependant types
120 - message passing primitives
121 - overloading for numbers
122 - exceptions ??
123 - ensure list_head type concept can work
124 - "union" type ??
125 - pattern matching for destructuring??
126 - casts??
127 - typeswitch?
128 - iso suffixes for number?
129 - foreach?
130 - break/continue or "next","last" - hopefully 'use' is enough
131 - algebraic types
132
133 Library functions:
134  - UTF8 string disection
135  - search, regexp
136  - cvt() interface an format() function
137  - parsing: rexep? LALR? sscan?
138  - buffered file IO
139  - auto-growing buffer including strings
140  - sockets
141  - http
142  - html
143  - gtk? xcb?