@@ -14,12 +14,14 @@ Performance, execution cost, and interpreter compatibility are critical.
1414- Use sparse comments explaining "why" not "how".
1515- Generated code should match existing idioms. Newer encoders such as QR Code are the best source of idiomatic code.
1616- Maintain existing user API (encoder interfaces and metadata).
17- - Warn about potential issues such as potential performance regressions in hot paths and when introducing new idioms.
1817- Static data should be hoisted out of the main procedure, and deferred with lazy initialisation if it must be derived
1918- Static and cached structures should be readonly
2019- Prefer stack work over dictionary heavy code
2120- Do not replace stack-based logic with dictionary-heavy abstractions.
2221- Do not refactor for readability at the expense of execution cost.
22+ - Search for pre-existing patterns before inventing code. Warn if the existing pattern does not appear to follow best practise.
23+ - Warn about potential issues such as potential performance regressions in hot paths.
24+ - Warn about potentially incorrect code when introducing new idioms involving stack-based constructions.
2325- Do not assume GhostScript-only execution. Assume modern implementation limit, and warn when approaching those limits:
2426 - Integer representation may be 32- or 64-bit. Do not assume overflow or promotion at 32-bit.
2527 - Maximum of 65535 entries within dictionaries, arrays, and on the stack. (Assume user might already have entries on the stack.)
@@ -31,7 +33,7 @@ Performance, execution cost, and interpreter compatibility are critical.
3133- AI is not very good at writing and reasoning about stack-based code.
3234- AI seems unable to accurately track the position of items on the stack, resulting in spurious inputs to ` index ` and ` roll ` .
3335- AI does not consider the side effect of inserting new code into existing stack based code, e.g. later indexes needing to be recalculated.
34- - AI should warn the user of areas of new or changed stack-based code that are likely to be incorrect .
36+ - AI benefits from being shown a preferred pattern then applying it .
3537
3638
3739## Build
0 commit comments