Something went wrong. Try again.
Monorepo for Aesthetic.Computer aesthetic.computer
Something went wrong. Try again.
Markdown
KidLisp Slide Mode #
Status: Planning
Created: 2025-01-19
Overview #
A special evaluative/communicative mode where all numeric parameters in KidLisp code become draggable "sliders" while all other code is locked. Dragging a number button adjusts its value based on decimal precision:
- Integer
150→ ±1 - Float
1.5→ ±0.1 - Float
1.05→ ±0.01
Core Behavior #
Activation #
- Toggle button to the left of the X (close) button
- Icon:
123symbol (represents numeric values) - Keyboard shortcut TBD
While Active #
- Numbers become buttons - Highlighted/styled as draggable elements
- Other code locked - Can't edit text, only drag numbers
- Immediate visual feedback - Partial re-evaluation happens on drag (no new
$codecreated) - No code persistence during slide - Changes are ephemeral until explicitly kept
Deactivation #
- Keep changes (optional): Creates new
$codewith modified values - Discard changes (default): Reverts to original
$code/values
Implementation Phases #
Phase 1: Monaco Editor UI (kidlisp.com) ✅ INITIAL IMPLEMENTATION #
Phase 2: KidLisp Interpreter Hooks #
Phase 3: Keep/Discard UI #
Phase 4: Prompt HUD Integration (FUTURE) #
Technical Notes #
Number Detection #
Use tokenizeForParser() which returns position info:
tokens.push({ value: token, pos: tokenStart });
Numeric regex: /^-?\d+\.?\d*$/ or similar
Decimal Precision Detection #
function getStep(numStr) {
if (!numStr.includes('.')) return 1;
const decimals = numStr.split('.')[1].length;
return Math.pow(10, -decimals);
}
// "150" → 1, "1.5" → 0.1, "1.05" → 0.01
Monaco Decoration API #
- Use
editor.deltaDecorations()for highlighting - Use
editor.addContentWidget()for interactive overlays - Or use inline CSS styling via decoration options
Partial Re-evaluation #
Need to track which AST nodes contain modified values and re-evaluate only those branches. May require:
- AST node → canvas command mapping
- Value replacement without full parse
- Frame-specific state isolation
Open Questions #
- Should drag sensitivity be linear or logarithmic for large numbers?
- How to handle negative numbers (drag left for more negative)?
- Should there be min/max constraints?
- How to handle numbers inside strings (ignore them)?
- Color values like
(ink 255 128 0)- special RGB slider UI?
Related Files #
/system/public/kidlisp.com/index.html- Main editor UI/system/public/aesthetic.computer/lib/kidlisp.mjs- Interpreter/system/public/aesthetic.computer/disks/prompt.mjs- Prompt HUD (future)