brainfuck interpreter
brainfuck cli rust
5

Configure Feed

Select the types of activity you want to include in your feed.

main, evaluator: replaced speed clap arg and variable with delay

makes argument intent much clearer

digi.rip (Jun 8, 2026, 6:30 PM EDT) 4276fb1e 4b3dbbb6

+12 -12
+9 -9
src/evaluator.rs
··· 88 88 input_type: IOFormat, 89 89 output_type: IOFormat, 90 90 tracing: bool, 91 - speed: u64, 91 + delay: u64, 92 92 } 93 93 94 94 pub struct VMBuilder { ··· 98 98 input_type: IOFormat, 99 99 output_type: IOFormat, 100 100 tracing: bool, 101 - speed: u64, 101 + delay: u64, 102 102 } 103 103 104 104 impl VMBuilder { ··· 110 110 input_type: IOFormat::Ascii, 111 111 output_type: IOFormat::Ascii, 112 112 tracing: false, 113 - speed: 0, 113 + delay: 0, 114 114 } 115 115 } 116 116 ··· 144 144 self 145 145 } 146 146 147 - pub fn speed(mut self, speed: u64) -> Self { 148 - self.speed = speed; 147 + pub fn delay(mut self, delay: u64) -> Self { 148 + self.delay = delay; 149 149 self 150 150 } 151 151 ··· 159 159 input_type: self.input_type, 160 160 output_type: self.output_type, 161 161 tracing: self.tracing, 162 - speed: self.speed, 162 + delay: self.delay, 163 163 } 164 164 } 165 165 } ··· 326 326 mut writer: W, 327 327 ) -> Result<(), RuntimeError> { 328 328 while self.inst_pointer < tokens.len() { 329 - thread::sleep(time::Duration::from_millis(self.speed)); 329 + thread::sleep(time::Duration::from_millis(self.delay)); 330 330 let current = tokens[self.inst_pointer]; 331 331 332 332 if self.tracing { 333 333 std::io::stdout().flush().ok(); 334 - if self.speed > 0 { 335 - print!("{}ms elapsed...", self.speed); 334 + if self.delay > 0 { 335 + print!("{}ms elapsed...", self.delay); 336 336 } 337 337 print!( 338 338 "\nTape: {}[{}] ",
+3 -3
src/main.rs
··· 45 45 #[arg( 46 46 short, 47 47 long, 48 - help = "set interpreter speed in milliseconds (useful with tracing!)", 48 + help = "set interpreter delay in ms between execution instructions", 49 49 default_value = "0" 50 50 )] 51 - speed: u64, 51 + delay: u64, 52 52 } 53 53 54 54 fn main() -> Result<(), Box<dyn std::error::Error>> { ··· 64 64 .input_type(args.input_type) 65 65 .output_type(args.output_type) 66 66 .tracing(args.tracing) 67 - .speed(args.speed) 67 + .delay(args.delay) 68 68 .build(); 69 69 machine.run( 70 70 &tokens,