Hacker News new | ask | show | jobs
by mousepilot 1871 days ago
I'm not that great a programmer, but this one seems easy to me, you write an interpreter in brainfuck that allows function definitions that support recursion, then include your recursive function definitions as an included constant then point your interpreter at the constant and tell it to run it. I assume bf allows constants but like I said I'm not that great a programmer.

Obviously using a recursive descent parser is out but thats probably easy to work around right?

I could be wrong tho so don't base mission critical code on this without rigorous testing!

1 comments

> I assume bf allows constants but like I said I'm not that great a programmer.

Key to being a good programmer: at least read a bit about the language before speculating about it. Not sure what you mean by "allows constants", but you're only given increment and decrement operators, and a promise that fresh tape is zeroed out.

Brainfuck supports iteration. Performing recursion in a higher level language will still look like iteration in Brainfuck.

100 percent agree, but honestly I couldn't make sense of the examples I looked at. It was probably just me tho.