lukad / bf Goto Github PK
View Code? Open in Web Editor NEWbf is a Brainfuck interpreter written in Elixir.
License: MIT License
bf is a Brainfuck interpreter written in Elixir.
License: MIT License
Hi,
There's a problem with the way you're optimising your brainfuck loops.
Specifically, empty loops should NOT be skipped by the interpreter.
This isn't usually a problem, because the programmer will normally make sure that empty loops aren't run as they are in fact infinite loops. I would say that the result of an infinite loop is undefined (obviously) so the best the interpreter can do is to drop out if an infinite loop is executed (With or without a message). However, you're not just eliminating empty loops, but some loops close to them too.
Specific tests:
++[[[[][]]][]]++
is an infinite loop eg: add 2, stop
+++[-][.+]-
is a set and a comment loop: set -1
>>[]
is move 2, loop{ stop }
This is an unusual bug and as BF optimisers will generally eliminate the problematic loops, will rarely cause a problem.
The programs I've found that break so far are: Lost Kingdom and my bf interpreter testing program
It also stops running Daniel B. Cristofani e
calculation program e.b after a few digits, but I'm not sure that's the same problem.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.