xref: /aosp_15_r20/external/emboss/doc/roadmap.md (revision 99e0aae7469b87d12f0ad23e61142c2d74c1ef70)
1# Emboss Roadmap
2
3Arrows indicate implementation order; that is, "A -> B -> C" means "C depends on
4B which depends on A."
5
6```dot {layout_engine=dot}
7digraph {
8  node [ shape=box target="_top" ]
9  edge [ dir="back" ]
10  rankdir="RL"
11
12  {
13    rank="sink"
14    misc [ label="Other" URL="#misc" ]
15    strings [ label="String Type" URL="#strings" ]
16    proto_back [ label="Proto Backend" URL="#proto_back" ]
17    arr_of_bits [ label="Packed Arrays" URL="#arr_of_bits" ]
18    array_stride [ label="Arbitrary Array Stride" URL="#array_stride" ]
19    dyn_array_elem_size [ label="Dynamic Elements" URL="#dyn_array_elem_size" ]
20    shift_ops [ label="<< and >>" URL="#shift_ops" ]
21    private [ label="Private Fields" URL="#private" ]
22    type_syn [ label="Type Syntax" URL="#type_syn" ]
23    division [ label="//" URL="#division" ]
24    exponent [ label="**" URL="#exponent" ]
25    requires [ label="[requires]" URL="#requires" ]
26  }
27
28  del_range [ label="rm [range]" URL="#del_range" ]
29  del_is_integer [ label="rm [is_integer]" URL="#del_is_integer" ]
30
31  {
32    rank="source"
33
34    del_anon_hack [ label="Unhack Anon Bits" URL="#del_anon_hack" ]
35    checksums [ label="CRC/Checksum" URL="#checksums" ]
36  }
37
38  del_is_integer -> type_syn
39
40  del_range -> requires
41  checksums -> requires
42  del_anon_hack -> private
43  del_is_integer -> exponent
44  del_is_integer -> division
45
46  open_source -> del_range
47  open_source -> del_is_integer
48
49  edge [style=dashed]
50}
51```
52
53[TOC]
54
55
56## Type Syntax {#type_syn}
57
58A syntax for expressing Emboss expression types.  Likely some variation of set
59builder notation:
60
61```
62  { x in $integer | 0 <= x <= 510 && x % 2 == 0 }
63```
64
65This is needed to replace the `[is_integer]` attribute
66
67
68## Remove `[is_integer]` {#del_is_integer}
69
70Replace the `[is_integer]` attribute on `external`s with a `[type]` attribute.
71This also lets us remove the hack in `expression_bounds.py`.  In passing, it
72should also allow `Flag` fields to be used as booleans in expressions.
73
74
75## Private Fields {#private}
76
77Provide some annotation -- likely an attribute -- that indicates that a field is
78"private:" that it should not appear in text format, and that it cannot be
79referenced from outside the structure.  From an end user perspective, this is
80primarily useful for virtual fields; internally, the automatic structure that
81wraps anonymous bits can also be marked private so that the backend can stop
82caring about `is_anonymous`.
83
84
85## Finishing Refactoring Hacky Anonymous Bits Code {#del_anon_hack}
86
87Replace the final uses of <code>*name*.is_anonymous</code> with something that
88marks "anonymous" fields as "private."
89
90
91
92## `[requires]` on Fields {#requires}
93
94Allow the `[requires]` attribute on fields, which can provide an arbitrary
95expression whose value must be `true` for the field to be `Ok()`.
96
97
98## Remove `[range]` {#del_range}
99
100Replace all extant uses of `[range: low..high]` with `[requires: low <= field <
101high]`, and remove support for `[range]`.
102
103
104## Native Checksum/CRC Support {#checksums}
105
106Add support for checking standard checksums/CRCs, and for automatically
107computing them.
108
109
110## Shift Operators (`<<` and `>>`) {#shift_ops}
111
112Left and right shift operators for use in expressions.
113
114
115## Flooring Integer Division (`//`) and Modulus (`%`) {#division}
116
117Flooring (not truncating) integer division for use in expressions, and the
118corresponding modulus operator.
119
120
121## Exponentiation (`**`)  {#exponent}
122
123Exponentiation operator.  Mostly needed for `[type]` on `UInt`, `Int`, and
124`Bcd`.
125
126
127## Arrays with Runtime-Sized Elements {#dyn_array_elem_size}
128
129Support for arrays where the element size is not known until runtime; e.g.,
130arrays of arrays, where the inner array's size is determined by some variable.
131
132
133## Arbitrary Array Stride {#array_stride}
134
135Support for arrays where the stride (distance between the starts of successive
136elements) is different from the element size.  Needed to support padding between
137elements and interlaced elements.
138
139
140## Large Arrays of `bits` {#arr_of_bits}
141
142Support for large, packed arrays of, e.g., 12-bit integers.  Requires such
143arrays to be byte-order-aware, and there are potential readability concerns.
144
145
146## Proto Backend {#proto_back}
147
148A backend which generates:
149
1501.   A `.proto` file with an "equivalent" set of types.
1512.   C++ code that can populate the protos from Emboss views and vice versa.
152
153Essentially, you would be able to serialize to and deserialize from the "proto
154form" the same way that you can currently serialize to and deserialize from
155text.
156
157
158## String Type {#strings}
159
160A physical type for strings.  This is complex, because strings can be stored in
161many formats.  It is likely that Emboss will only support byte strings, and will
162not directly handle character encodings, but that still leaves a number of
163common formats:
164
1651.   Length-specified: length is determined by another field.
1662.   Delimited: string runs until some delimiter byte; usually zero, but
167     sometimes ASCII space or '$'.
1683.   Optionally-delimited: string runs until either a delimiter byte *or* some
169     maximum size.
1704.   Right-padded: string bytes run to some maximum size, but padding bytes
171     (usually ASCII space) should be chopped off the end.  Bytes with the
172     padding value can appear in the middle.
173
174
175## Miscellaneous/Potential Features {#misc}
176
177These features could happen if there is interest, but there is no current plan
178to implement them.
179
180
181### Fixed Point
182
183Support for fixed-point arithmetic, both in expressions and physical formats.
184
185
186### Documentation Backend
187
188Support for an HTML/PDF/???-format documentation generator.
189
190
191### Python Backend
192
193A code generator for Python.
194