Skip to main content

Reversible BitFuck (RBF) interpreter

Project description

rbf-lang

PyPI version publish Ruff Python versions Snapcraft

Reversible BitFuck (RBF) is a reversible Turing tarpit. It is based on a tape of bits and has 5 commands:

  • * Toggle the current bit
  • > Shift the tape head right
  • < Shift the tape head left
  • ( If the current bit is zero, jump past matching )
  • ) If the current bit is zero, jump to just after matching (

Here is an example program operating on 3 bits. Bit 0 is the source bit (x), bit 1 is the target bit (y) and bit 2 is the temporary bit (f). Here the value of x is being moved to y.

# x=?, y=0, f=0
(>>*<<)        # set f if x is set
>>(            # if f is set
    <(>*<)*    # set y
    <*(>>*<<)  # unset x
>>)
<(>*<)         # if y is set, unset f

we can run the above program on an example tape (100) with rbf cli:

rbf run -t 100 "(>>*<<)>>(<(>*<)*<*(>>*<<)>>)<(>*<)"  # outputs 010

Since RBF is reversible, we can easily create a move left program:

rbf reverse "(>>*<<)>>(<(>*<)*<*(>>*<<)>>)<(>*<)"  # outputs (>*<)>(<<(>>*<<)*>*(>*<)>)<<(>>*<<)

installation

RBF can be installed from source with

pip install .

or from pypi with

pip install rbf-lang

links

(as of yet uncategorised links to related topics. Will be sorted and expanded in the future)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rbf_lang-0.2.2.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rbf_lang-0.2.2-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file rbf_lang-0.2.2.tar.gz.

File metadata

  • Download URL: rbf_lang-0.2.2.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.5

File hashes

Hashes for rbf_lang-0.2.2.tar.gz
Algorithm Hash digest
SHA256 1778ddd10b76890ea8bd352b990edc739f82efd8d9d2a9f5c4fc8de85c4921f3
MD5 ab11e437f55f5d961031b52b94f1bc21
BLAKE2b-256 5f6d97862e22ca06c1b95201103f1114bea5ed3738512126a17e760e6c0d9d9a

See more details on using hashes here.

File details

Details for the file rbf_lang-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: rbf_lang-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.5

File hashes

Hashes for rbf_lang-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6401363ac0529bd00902080a2e0212ff7154524bf00a1ca1067c14e3658468f9
MD5 8af380559328265b8a910094c2b58ebb
BLAKE2b-256 5b2c412d9c470d0962a2f6558aa0f6ac2b1685409fbfb18967b533cdd7568d94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page