Filed under "Things I've put far too much effort into"...

Introducing DuckFuck: A flexible, modular D-based interpreter/conversion system for FuckFuck and other BrainFuck-based languages. Includes the DuckFucker: A command-line tool to interpret any supported language.

Currently supported:

Languages:

Backends:

  • Compile time conversion to D
  • Runtime Interpreter

Sample usage:

// Hello World! Interpreted brainfuck at runtime. brainfuck(" This is a basic hello world in brainfuck >+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.>>>++++++++[<++++>-] <.>>>++++++++++[<+++++++++>-]<---.<<<<.+++.------.--------.>>+. Neat huh? "); writeln(); // Echo. Converted from fuckfuck to D at compile-time. auto echoThis = "Echo this!"; mixin(fuckfuck!(echoThis, null, " /* This is 'echo' in fuckfuck */ knob /* read input to current tape cell */ ARSE /* Inside the loop */ COCKKNOB /* write output at current tape cell, read input */ B U T T /* repeat until current tape cell is \x00 (ie, end of file - automatically sent when input string is exhausted) */ "));

or:

$duckfucker hello.bf Hello World! $duckfucker echo.ff < input.txt > output.txt

Input and output can be from (mix and match!):

  • stdin/stdout (default)
  • named array
  • generator/sink function

Links:

Read more