more
This commit is contained in:
28
GEMINI.md
28
GEMINI.md
@@ -38,3 +38,31 @@ Based on the curation in `./references/`, the resulting system MUST adhere to th
|
||||
4. **Preemptive Scatter ("Tape Drive"):** Function arguments are not pushed to a stack before a call. They are "scattered" into pre-allocated, contiguous global memory slots during compilation/initialization. The function simply reads from these known offsets, eliminating argument gathering overhead.
|
||||
5. **No `if/then` branches:** Rely on hardware-level flags like conditional returns (`ret-if-signed`) combined with factored calls to avoid writing complex AST parsers.
|
||||
6. **No Dependencies:** C implementation must be minimal (`-nostdlib`), ideally running directly against OS APIs (e.g., WinAPI `VirtualAlloc`, `ExitProcess`, `GDI32` for rendering).
|
||||
|
||||
## Current Development Roadmap (attempt_1)
|
||||
|
||||
Here's a breakdown of the next steps to advance the `attempt_1` implementation towards a ColorForth derivative:
|
||||
|
||||
1. **Enhance Lexer/Parser/Compiler (JIT) in `main.c`:**
|
||||
* **Token Interpretation:** Refine the interpretation of the 28-bit payload based on the 4-bit color tag (e.g., differentiate between immediate values, dictionary IDs, and data addresses).
|
||||
* **Dictionary Lookup:** Improve the efficiency and scalability of dictionary lookups for custom words beyond the current linear search.
|
||||
* **New Word Definition:** Implement mechanisms for defining new Forth words directly within the editor, compiling them into the `code_arena`.
|
||||
|
||||
2. **Refine Visual Editor (`win_proc` in `main.c`):**
|
||||
* **Dynamic Colorization:** Ensure all rendered tokens accurately reflect their 4-bit color tags, updating dynamically with changes.
|
||||
* **Annotation Handling:** Implement more sophisticated display for token annotations, supporting up to 8 characters clearly without truncation or visual artifacts.
|
||||
* **Input Handling:** Improve text input for `STag_Data` (e.g., supporting full hexadecimal input, backspace functionality).
|
||||
* **Cursor Behavior:** Ensure the cursor accurately reflects the current editing position within the token stream.
|
||||
|
||||
3. **Expand Register-Only Stack Operations:**
|
||||
* Implement core Forth stack manipulation words (e.g., `DUP`, `DROP`, `OVER`, `ROT`) by generating appropriate x86-64 assembly instructions that operate solely on `RAX` and `RDX`.
|
||||
|
||||
4. **Develop `Tape Drive` Memory Management:**
|
||||
* Ensure all memory access (read/write) for Forth variables and data structures correctly utilize the `vm_globals` array and the "preemptive scatter" approach.
|
||||
|
||||
5. **Implement Control Flow without Branches:**
|
||||
* Leverage conditional returns and factored calls to create more complex control flow structures (e.g., `IF`/`ELSE`/`THEN` equivalents) without introducing explicit `jmp` instructions where not architecturally intended.
|
||||
|
||||
6. **Continuous Validation & Debugging:**
|
||||
* Enhance debugging output within the UI to provide clearer insight into VM state (RAX, RDX, global memory, log buffer) during execution.
|
||||
* Consider adding simple "tests" as Forth sequences within `tape_arena` to verify new features.
|
||||
|
||||
Reference in New Issue
Block a user