All Projects → mertyildiran → ldca

mertyildiran / ldca

Licence: GPL-3.0 license
Self-replicating, self-modifying Assembly program that can evolve into every possible computer program in the universe (EXPERIMENTAL)

Programming Languages

assembly
5116 projects
python
139335 projects - #7 most used programming language
shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to ldca

Rhisis
Rhisis is an experimental FlyFF MMORPG emulator built with C# 9 and .NET 5
Stars: ✭ 132 (+206.98%)
Mutual labels:  experimental
Bitglitter
⚡ Embed data payloads inside of ordinary images or video with high-performance animated 2-D barcodes. (Python library)
Stars: ✭ 193 (+348.84%)
Mutual labels:  experimental
SimpleGP
Simple Genetic Programming for Symbolic Regression in Python3
Stars: ✭ 20 (-53.49%)
Mutual labels:  evolutionary-algorithms
Minet
CVPR2020, Multi-scale Interactive Network for Salient Object Detection
Stars: ✭ 155 (+260.47%)
Mutual labels:  experimental
Vue Hooks Foodapp
A food app using a few hooks in Vue to show how they can work (experimental)
Stars: ✭ 179 (+316.28%)
Mutual labels:  experimental
Api Linter
A linter for APIs defined in protocol buffers.
Stars: ✭ 197 (+358.14%)
Mutual labels:  experimental
Simple
The Simple Intelligent and Modular Programming Language and Environment
Stars: ✭ 120 (+179.07%)
Mutual labels:  experimental
haskell-hot-swap
Hot swapping compiled code while keeping a websocket connection open
Stars: ✭ 24 (-44.19%)
Mutual labels:  experimental
Jpeg Compressor
Research JPEG encoder
Stars: ✭ 179 (+316.28%)
Mutual labels:  experimental
datafsm
Machine Learning Finite State Machine Models from Data with Genetic Algorithms
Stars: ✭ 14 (-67.44%)
Mutual labels:  evolutionary-algorithms
Lisp Chat
An experimental minimal chat written in Common Lisp
Stars: ✭ 160 (+272.09%)
Mutual labels:  experimental
Goluago
[on hold] Port of Lua 5.1 interpreter to Go Language Toolchain. [Work In Progress.] See also: http://lua.org and http://golang.org
Stars: ✭ 177 (+311.63%)
Mutual labels:  experimental
Benchmarknet
Benchmark for testing the reliable UDP networking solutions
Stars: ✭ 206 (+379.07%)
Mutual labels:  experimental
Alma
ALgoloid with MAcros -- a language with Algol-family syntax where macros take center stage
Stars: ✭ 132 (+206.98%)
Mutual labels:  experimental
ruck
🧬 Modularised Evolutionary Algorithms For Python with Optional JIT and Multiprocessing (Ray) support. Inspired by PyTorch Lightning
Stars: ✭ 50 (+16.28%)
Mutual labels:  evolutionary-algorithms
Thismypc
ThisMyPC provides a neat web interface that can be used for browsing your desktop drives from any device in your browser itself. With the help of NodeJs, the file details are displayed in JSON format that can then we easily displayed in web browsers.
Stars: ✭ 128 (+197.67%)
Mutual labels:  experimental
Sapling
A highly experimental vi-inspired editor where you edit code, not text.
Stars: ✭ 195 (+353.49%)
Mutual labels:  experimental
machine-learning-blackjack-solution
Finding an optimal Blackjack strategy using AI
Stars: ✭ 40 (-6.98%)
Mutual labels:  evolutionary-algorithms
cocol
Rapid blockchain prototyping
Stars: ✭ 19 (-55.81%)
Mutual labels:  experimental
Optimized-MDVRP
"Using Genetic Algorithms for Multi-depot Vehicle Routing" paper implementation.
Stars: ✭ 30 (-30.23%)
Mutual labels:  evolutionary-algorithms

Last Digital Common Ancestor (LDCA)

Self-replicating, self-modifying Assembly program that can evolve into every possible computer program in the universe.

LDCA

NASM is required to compile the Assembly program.

Compiling & Running

CAUTION: Since this program executes random CPU instructions, it might run potentialy harmful machine code of any kind. For example: You can accidentally delete a file from your disk or change some configuration in your system. Although it's statistically insignificant, you should still run it in an isolated environment. Also read the NOTICE below.

NOTICE: Program execution (that executes random CPU instructions) is disabled temporarily. To re-enable it, remove ; before the call program occurences in ldca.asm file.

Go into the directory that matches your operating system and CPU architecture combination. For example: cd linux_x86

Run: make

The binary should be ready on outs/0000000000000000000000000000000000000000000000000

Go into the outs/ directory and run it:

cd outs/
./0000000000000000000000000000000000000000000000000
cd ..

Now you should be seeing these three binaries:

$ ls outs/
0000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000001
0000000000000000000000000000000000000000000000002

that means it's replicated and created 2 offsprings.

Now you can run these commands sequentially to achieve the results shown in the animation at the top:

clear
make clean
make
make strace
make diff

or simply run:

./dev.sh

Development

For development purposes, it's better to run the program for a brief amount of time like this:

clear
make clean
make
timeout 0.2 make strace
make diff

so that it will only generate a few hundred programs.

Where are the descendants?

The descendants are in the same directory that you run the initial program 0000000000000000000000000000000000000000000000000. Don't try to run ls to see the list of files if you run the program for a few minutes. Use ls --sort=none instead.

How do I remove these generated programs?

Do not try to run rm * inside the outs/ because rm cannot handle that amount files. Go into parent directory cd .. and use rm -f outs/ instead.

Why is it called Last Digital Common Ancestor?

Because it's the digital version of Last Universal Common Ancestor. If you look at it from a philosophical point of view, LDCA is actually a descendant of LUCA.

Algorithm

The Assembly program first executes the subroutine named program which is the section that actually evolves. Then the program replicates itself. While replicating, with 50% probability one of the random mutations, that are listed below, happens:

  • with 80% probability replace a randomly chosen byte in the program section with a random byte.
  • with 5% probability shrink the program section randomly by a factor of 1 byte to program section's size.
  • with 15% probability grow the program section randomly by a factor of 1 byte to 256 bytes and fill it with random bytes.

Replication creates a new binary using system calls by copying the memory region which the program's itself loaded into. Then executes the newly created binary by forking using system calls. Replication happens two times for each successful program execution. So the number of processes increases exponentially.

Programs that created after a random mutation might fail to reach to replicate subroutine. Such programs cannot produce its offsprings.

To be able to fully understand the algorithm you should go through the lines of ldca.asm Assembly code and read the comments.

Constants

There are some constants that hard-coded into the Assembly program which are open to optimization:

  • Filename length: 49
  • Body of the subroutine named program
  • 50% evolution rate: rndNum 0, 1
  • Grow size: Between 1 byte and 256 bytes (rndNum 1, 256)
  • 80% random byte mutation chance: cmp eax, 80
  • 5% shrink mutation chance: cmp eax, 85
  • 15% grow mutation chance: 100 - 85

License

Last Digital Common Ancestor is licensed under the GNU General Public License v3.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].