Giter Site home page Giter Site logo

bf's Introduction

Hi there ๐Ÿ‘‹

bf's People

Contributors

lukad avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

bf's Issues

Mis-optimising loops.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.