6 ms·
Would a mind greater than I please weigh in on a potential path to using BrainFuck to do some type of meaningful task (simple server, cli tool, etc)? From what
by gorpomon 8y ago
Would a mind greater than I please weigh in on a potential path to using BrainFuck to do some type of meaningful task (simple server, cli tool, etc)?
From what I can tell, the best bet is using it to to write the source code for another language and run that code since most examples seem to just print strings or increment values.
Is there a meaningful set of primitives one can incrementally build on the core language to make usable code?
- schoen 8y agoI think the likely path would be a compiler that compiles some other language to BrainFuck. As BrainFuck is Turing-complete, such a compiler can be constructed. An example of a compiler for an even more restricted environment might be https://github.com/xoreaxeaxeax/movfuscator https://github.com/xoreaxeaxeax/movfuscator Edit: in the same vein there's also https://esolangs.org/wiki/Higher_Subleq https://esolangs.org/wiki/Higher_Subleq Further edit: The user Someone posted a link in this thread to several existing compilers that already target Brainfuck (!). That's awesome.
- shagie 8y agoThere is also some ability to explore optimization strategies. http://calmerthanyouare.org/2015/01/07/optimizing-brainfuck.html http://calmerthanyouare.org/2015/01/07/optimizing-brainfuck.... As it’s such a limited language, it is something that may be more accessible (compare optimizing MIPS).
- wintorez 8y agoI read a while back that it's a good language for generating code using genetic algorithms: http://lapinozz.github.io/project/2016/03/27/generating-brainfuck-code-using-genetic-algorithm.html http://lapinozz.github.io/project/2016/03/27/generating-brai...
- Someone 8y agoYour best bet is to transpile a language you’re more productive in to it. See https://esolangs.org/wiki/Brainfuck_code_generation https://esolangs.org/wiki/Brainfuck_code_generation
- bryanrasmussen 8y agohttps://www.codeproject.com/Articles/558979/BrainFix-the-language-that-translates-to-fluent-Br https://www.codeproject.com/Articles/558979/BrainFix-the-lan...
- tathougies 8y agoIt would be an interesting exercise to design a lambda calculus evaluation strategy and then a compiler to convert an arbitrary lambda expression into this dialect of concurrent brainfuck. This would let you access the massive parallelism already apparent in lambda calculus expressions 'for free'. The issue of course is finding an evaluation strategy that doesn't explode the memory complexity as well.
- tromp 8y agoOr skip the brainfuck and start from the simplest possible lambda calculus machine http://www.ioccc.org/2012/tromp/tromp.c http://www.ioccc.org/2012/tromp/tromp.c http://www.ioccc.org/2012/tromp/hint.html http://www.ioccc.org/2012/tromp/hint.html
- shakna 8y agoThanks to BFBASIC there's a small digital jewel safe running brainfuck as it's core in a couple casinos. It was doable, and matched security expectations, but it feels like twenty years ago. The tooling isn't quite there, so you end up working around the compiler and injecting hand written bf, like we used to with assembly.
- aeontech 8y agoThat’s kind of amazing... could you share why? Just to prove it could be done?
- shakna 8y agoSecurity requirements by the hotel. They wanted everything to be running obfuscated code. They gave me a choice of Malboge or Brainfuck, neither of which I knew before the contract.
- imtringued 8y ago>Malboge Did they give you access to a super computer?
- dkersten 8y agoThat seems like a ridiculous security requirement, but also like a rather interesting project to work on! The ultimate security through obscurity.
- shakna 8y agoIt was certainly fun at the beginning, and I think they were aiming for crazy levels of security, and obscurity sounded nice to someone. But the tooling really isn't there. Ended up using 'make' and 'm4' as preprocessors to work around things.
- cdancette 8y agoThis is a joke right? That's a crazy requirement