go-vise

Constrained Size Output Virtual Machine
Info | Log | Files | Refs | README | LICENSE

draft.txt (4311B)


      1 Input handler:
      2 
      3 Must handle inputs that contain full history aswell as just last input.
      4 
      5 - Previous input
      6 - Current input
      7 - browse state (stack of all selectors)
      8 
      9 
     10 ---
     11 
     12 session state:
     13 
     14 - session id
     15 - input stack
     16 - router
     17 - user state
     18 - symbol stack and output cache (need to know whether list or not)
     19 - current cumulative size of symbol stack
     20 - sizelimit for symbol stack
     21 
     22 debug state:
     23 
     24 - each step:
     25 	* (session)
     26 	* last input
     27 	* state
     28 	* symbol
     29 
     30 
     31 ---
     32 
     33 Account states:
     34 
     35 Should be refreshed before each step.
     36 
     37 Interpreted state used to conditionally redirect locations (needs loop detection).
     38 
     39 Always part of context. May change asynchronously.
     40 
     41 Allow for global state overrides (routes immediately, no state changes)
     42 
     43 catch jumps to symbol with back option (e.g. invalid input)
     44 panic jump to symbol and terminates session
     45 
     46 States are defined in VM. The must be REQUIREd before use.
     47 
     48 If states are changed, ALL sessions MUST be invalidated.
     49 
     50 CATCH <symbol> <[!]state>
     51 CROAK <symbol> <[!]state> 
     52 
     53 
     54 ---
     55 
     56 Parameter requires:
     57 
     58 Every node should declare zero or more parameter requirements.
     59 
     60 Parameter requirements are inherited in a branch.
     61 
     62 Compiler should complain about redeclarations in same branch or gosub
     63 
     64 Parameter must resolve to a code symbol
     65 
     66 include command to refresh (for example reload list render)
     67 
     68 parameter symbol may only appear once for all branches (when jumping, a parameter require must originate in same place in tree)
     69 
     70 load symbol -> load symbol from this point on up to size.
     71 reload symbol -> flush symbol before rendering, will fail of not previously required. Will use size from preceding LOAD instruction. 
     72 
     73 LOAD <symbol> <size>
     74 RELOAD <symbol>
     75 
     76 
     77 ---
     78 
     79 Navigation:
     80 
     81 Down - keeps inherited requirements
     82 Up - invalidates requirements out of scope, (symbol filled automatically in context of previous "down")
     83 Next - advance content same level (list browsing)
     84 Previous - go back content same level (list browsing) 
     85 Goto - jump to other branch clears requirements stack (should still traverse up and down)
     86 Exit - terminate session
     87 
     88 Next and Previous needs to keep an index state.
     89 
     90 List content display chunking must be cached. List content cache must have a limited size.
     91 
     92 0 = UP (if valid)
     93 1 = NEXT
     94 2 = PREVIOUS
     95 ... = GOTO / COND / DOWN
     96 00 = EXIT
     97 99 - GOTO top
     98 
     99 (selector = input, display is description displayed in menu)
    100 
    101 UP <selector> <display> <symbol>
    102 DOWN <selector> <display> <symbol>
    103 NEXT <selector> <display>
    104 PREV <selector> <display>
    105 GOTO <selector> <display> <symbol>
    106 EXIT <selector> <display>
    107 COND <selector> <display> <symbol> <[!]state>
    108 VAL <symbol>
    109 
    110 kept in session as a router object:
    111 
    112 SELECTORHASH|SYMBOLHASH
    113 
    114 Selectorhash 0x0 is VAL
    115 
    116 
    117 ---
    118 
    119 Parameter mapping
    120 
    121 Used to render display
    122 
    123 Referenced by symbol name.
    124 
    125 Must set minsize, maxsize, used by compiler to evaluate display size.
    126 
    127 For symbols having data larger than maxsize, data should be lazily split up to each threshold (to enable previous screens same as initial). Can be defined by byte markers (not substring copies).
    128 
    129 Total capacity for mapping is cumulative maxsize. Next param in execution has available up to net capacity after consume.
    130 
    131 May define ONE sink, which consumes all remaining data. A sink is a LOAd with size 0
    132 
    133 Compiler must croak if:
    134 
    135 - parameter has not been loaded in tree
    136 - symbol is not handled by any of the translations.
    137 
    138 should generate warnings if sink cannot render a single enrry (of list)
    139 
    140 MAP <symbol>
    141 
    142 ---
    143 
    144 Display
    145 
    146 matched with this node id. node ids must be unique. should contain only letters and numbers.
    147 
    148 ID <identifier string>
    149 
    150 compile displays with menus.
    151 
    152 ---
    153 
    154 Compiler croaks:
    155 
    156 - Render larger than display size (using maxsize)
    157 - Parameter duplicates between branches
    158 - Parameter mapped outsize context
    159 - Unhandled parameter mappings
    160 - Duplicate navigation selectors in a menu
    161 - Parameter loads exceeding global capacity limit
    162 
    163 
    164 ---
    165 
    166 All code execution symbols only take state object as input and return it as output.
    167 
    168 The output is committed within session.
    169 
    170 
    171 ---
    172 
    173 Header
    174 
    175 Engine version definition file was written for
    176 
    177 VERSION
    178 
    179 
    180 ---
    181 
    182 Debug:
    183 
    184 - full input history
    185 - parameter dump
    186 - capacities, load capacities, used capacities
    187 
    188 
    189 ---
    190 
    191 Tool to generate template.
    192 
    193 - parent id
    194 - generate id
    195 - UP, EXIT, GOTO TOP selector
    196 - browser? if so, NEXT and PREVIOUS
    197 - skip top option