Skip to main content

Reversible BitFuck (RBF) interpretor

Project description

rbf-lang

PyPI version publish Ruff Python versions

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.1.tar.gz (21.9 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.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rbf_lang-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9b7caa9cea632702630572aa709c316e1687d437f901d12ceef789ae8480b0aa
MD5 600f4433617830b88d32b5b35bf5f974
BLAKE2b-256 1b6ccbef42f286a0e1e30f4358cbe305366bddee049b775c9ca4b535f0be072f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rbf_lang-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ddb09b010e1fabd3bee3b4d0b06ef592432064587883f595b2f29b533c0d7e90
MD5 331db73657d9d1c58931ea85ead6e456
BLAKE2b-256 57f65b3defc3f295d4e192f266f0f8a0b2084354870e4487dc8730cab48258b2

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