Skip to content

Remove Unreachable Code #20

@nixpulvis

Description

@nixpulvis

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions