wmww / BrainfuckIDE

A Brainfuck IDE/debugger designed to be intuitive, featureful and visually appealing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Decouple frontend and branfuck runtime

wmww opened this issue · comments

data_display.gd currently manages both the internal representation of the data tape, and the visual display representation. Other bits of the brainfuck runtime (parsing and interpreting) are scattered throughout the code base. Purposed solution:

  1. design a clean interface between the runtime and the rest of the code, this should support:
    • Adding instructions to the queue
    • Dequeueing and running one instruction at a time
    • Running many instructions as fast as possible
    • Fetching a portion of the data tape for display
    • Endless loop handling
    • more?
  2. Implement this in GDScript
  3. Port the visual frontend to use it

Advantages:

  • Cleaner code
  • Easier to add optimizations (see #5)
  • Frontend can be designed such that it does not create nodes for every data cell in use (this allows for brainfuck programs with much larger memory requirements to run)
  • brainfuck implementations can be interchangeable (even 3rd party ones could be added)