Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Unreachable Code #20

Open
nixpulvis opened this issue Dec 16, 2015 · 0 comments
Open

Remove Unreachable Code #20

nixpulvis opened this issue Dec 16, 2015 · 0 comments

Comments

@nixpulvis
Copy link
Owner

In an effort to start some simple optimizations, we could save a bunch of space in some brainfuck programs by determining up front that some while loops (aka [...] constructs) will never be entered, and can be removed.

A baseline argument could be if there has been no reachable user input, then we can calculate the values of each cell. This might be expensive, so maybe for a start we simply track readable values until the first reached loop.

This covers the most common case of using a loop for comments at the beginning of a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant