Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Self-replicating Brainfuck programs

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
542 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Aug 1, 2011

In general this is just a Brainfuck Virtual Machines. But there are some differences to Urban Müller's Brainfuck:
* Von-Neumann architecture: Code and Data reside in same memory
* Multi-threading: This Brainfuck VM supports multi-threading (command 'Y' forks)
* Stack: I've added commands to push ('^') and pop ('V') data from a stack (command '$' sets stack pointer to current data pointer)
* Memory is simulated to be endless in both directions. Therefore there is a command to terminate a thread ('*')
* I've also added statistical errors (mutations): 1) Cosmic-ray mutation: Random bits in memory are mutated 2) Instruction error: Some instructions are ignored
(but errors/mutations are of course very rare)
* Command ',' doesn't read from keyboard, but from a random number generator
* Also note that all memory is initialized randomly (except for locations where a program is loaded)

Then I wrote some basic programs, which were able to reproduce and started the Virtual Machines. It's quite interesting to see how programs compete while overwriting each other. The random mutations then are a motor for evolution and some different programs evolve. Sometimes two programs reproduce to the same location and therefore do secual reproduction. If the resulting program is able to reproduce itself, a new species evolved, and I viewed a lot of newly-evolved species.

Source code is now available at GitHub:
https://github.com/jgraef/replifuck

  • likes, 1 dislikes

Link to this comment:

Share to:
see all

All Comments (2)

Sign In or Sign Up now to post a comment!
  • @aljoshabre

    The source code can be found at GitHub. I've put the URL into the video description.

    There is no documentation at all (except for the F1 key in the program). But I wrote some comments into the source code - especially into the source code of the brainfuck programs.

  • I'd love to see the source code of this VM of yours; if it's well commented/documented(?).

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more