Ben Olmstead | c0d7784 | 2019-07-31 17:34:05 -0700 | [diff] [blame] | 1 | # Emboss Roadmap |
| 2 | |
| 3 | Arrows indicate implementation order; that is, "A -> B -> C" means "C depends on |
| 4 | B which depends on A." |
| 5 | |
| 6 | ```dot {layout_engine=dot} |
| 7 | digraph { |
| 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 | |
| 58 | A syntax for expressing Emboss expression types. Likely some variation of set |
| 59 | builder notation: |
| 60 | |
| 61 | ``` |
| 62 | { x in $integer | 0 <= x <= 510 && x % 2 == 0 } |
| 63 | ``` |
| 64 | |
| 65 | This is needed to replace the `[is_integer]` attribute |
| 66 | |
| 67 | |
| 68 | ## Remove `[is_integer]` {#del_is_integer} |
| 69 | |
| 70 | Replace the `[is_integer]` attribute on `external`s with a `[type]` attribute. |
| 71 | This also lets us remove the hack in `expression_bounds.py`. In passing, it |
| 72 | should also allow `Flag` fields to be used as booleans in expressions. |
| 73 | |
| 74 | |
| 75 | ## Private Fields {#private} |
| 76 | |
| 77 | Provide 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 |
| 79 | referenced from outside the structure. From an end user perspective, this is |
| 80 | primarily useful for virtual fields; internally, the automatic structure that |
| 81 | wraps anonymous bits can also be marked private so that the backend can stop |
| 82 | caring about `is_anonymous`. |
| 83 | |
| 84 | |
| 85 | ## Finishing Refactoring Hacky Anonymous Bits Code {#del_anon_hack} |
| 86 | |
reventlov | d472a20 | 2022-04-08 15:53:23 -0700 | [diff] [blame] | 87 | Replace the final uses of <code>*name*.is_anonymous</code> with something that |
| 88 | marks "anonymous" fields as "private." |
Ben Olmstead | c0d7784 | 2019-07-31 17:34:05 -0700 | [diff] [blame] | 89 | |
| 90 | |
| 91 | |
| 92 | ## `[requires]` on Fields {#requires} |
| 93 | |
| 94 | Allow the `[requires]` attribute on fields, which can provide an arbitrary |
| 95 | expression whose value must be `true` for the field to be `Ok()`. |
| 96 | |
| 97 | |
| 98 | ## Remove `[range]` {#del_range} |
| 99 | |
| 100 | Replace all extant uses of `[range: low..high]` with `[requires: low <= field < |
| 101 | high]`, and remove support for `[range]`. |
| 102 | |
| 103 | |
| 104 | ## Native Checksum/CRC Support {#checksums} |
| 105 | |
| 106 | Add support for checking standard checksums/CRCs, and for automatically |
| 107 | computing them. |
| 108 | |
| 109 | |
| 110 | ## Shift Operators (`<<` and `>>`) {#shift_ops} |
| 111 | |
| 112 | Left and right shift operators for use in expressions. |
| 113 | |
| 114 | |
| 115 | ## Flooring Integer Division (`//`) and Modulus (`%`) {#division} |
| 116 | |
| 117 | Flooring (not truncating) integer division for use in expressions, and the |
| 118 | corresponding modulus operator. |
| 119 | |
| 120 | |
| 121 | ## Exponentiation (`**`) {#exponent} |
| 122 | |
| 123 | Exponentiation operator. Mostly needed for `[type]` on `UInt`, `Int`, and |
| 124 | `Bcd`. |
| 125 | |
| 126 | |
| 127 | ## Arrays with Runtime-Sized Elements {#dyn_array_elem_size} |
| 128 | |
| 129 | Support for arrays where the element size is not known until runtime; e.g., |
| 130 | arrays of arrays, where the inner array's size is determined by some variable. |
| 131 | |
| 132 | |
| 133 | ## Arbitrary Array Stride {#array_stride} |
| 134 | |
| 135 | Support for arrays where the stride (distance between the starts of successive |
| 136 | elements) is different from the element size. Needed to support padding between |
| 137 | elements and interlaced elements. |
| 138 | |
| 139 | |
| 140 | ## Large Arrays of `bits` {#arr_of_bits} |
| 141 | |
| 142 | Support for large, packed arrays of, e.g., 12-bit integers. Requires such |
| 143 | arrays to be byte-order-aware, and there are potential readability concerns. |
| 144 | |
| 145 | |
| 146 | ## Proto Backend {#proto_back} |
| 147 | |
| 148 | A backend which generates: |
| 149 | |
| 150 | 1. A `.proto` file with an "equivalent" set of types. |
| 151 | 2. C++ code that can populate the protos from Emboss views and vice versa. |
| 152 | |
| 153 | Essentially, you would be able to serialize to and deserialize from the "proto |
| 154 | form" the same way that you can currently serialize to and deserialize from |
| 155 | text. |
| 156 | |
| 157 | |
| 158 | ## String Type {#strings} |
| 159 | |
| 160 | A physical type for strings. This is complex, because strings can be stored in |
| 161 | many formats. It is likely that Emboss will only support byte strings, and will |
| 162 | not directly handle character encodings, but that still leaves a number of |
| 163 | common formats: |
| 164 | |
| 165 | 1. Length-specified: length is determined by another field. |
| 166 | 2. Delimited: string runs until some delimiter byte; usually zero, but |
| 167 | sometimes ASCII space or '$'. |
| 168 | 3. Optionally-delimited: string runs until either a delimiter byte *or* some |
| 169 | maximum size. |
| 170 | 4. 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 | |
| 177 | These features could happen if there is interest, but there is no current plan |
| 178 | to implement them. |
| 179 | |
| 180 | |
| 181 | ### Fixed Point |
| 182 | |
| 183 | Support for fixed-point arithmetic, both in expressions and physical formats. |
| 184 | |
| 185 | |
| 186 | ### Documentation Backend |
| 187 | |
| 188 | Support for an HTML/PDF/???-format documentation generator. |
| 189 | |
| 190 | |
| 191 | ### Python Backend |
| 192 | |
| 193 | A code generator for Python. |