1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
# SALIS: A-life Simulator

*SALIS simulation running the V1 architecture with the curses user interface*
## Overview
*SALIS* is a platform for conducting artificial life experiments. It enables
the development of Tierra-like virtual machines, with certain limitations. For
newcomers, I recommend exploring Tierra first. The following resources provide
valuable context and insight into the motivations and implementation of both
Tierra and this project:
- [Video about Tierra](https://www.youtube.com/watch?v=Wl5rRGVD0QI)
- [Read about Tierra](https://tomray.me/pubs/doc/index.html#What)
## SALIS V1 Reimplementation
A fully functional clone of the V1 architecture for the SALIS virtual machine
has been implemented using the tools available in this repository. For more
information on the V1 architecture, including its similarities and differences
with the original Tierra simulator, check out the following resources:
- [SALIS V1 repository](https://git.pauloliver.dev/salis-v1/about/)
- [SALIS V1 introductory playlist](https://www.youtube.com/watch?v=jCFmOCvy6po&list=PLrEmYrpTcDJY2NdGL6B7wIRbKGp_6NkxY)
## Usage
*SALIS* simulations are initialized using the provided `salis.py` python script.
Use `salis.py new [...]` to start new simulations and `salis.py load [...]` to
load saved simulations. For a full list of available arguments for each command,
run `salis.py new --help` and `salis.py load --help`, respectively.
The python script compiles a temporary executable on the fly (compilation
typically takes less than a second) based on the specified arguments and
launches it immediately.
Different VM architectures can be implemented as standalone C files, plus an
associated `arch_vars.py` script, within in the `arch/` directory. When creating
a new simulation, you can select a specific architecture using the `--arch`
argument.
Similarly, different user interfaces are implemented as C files, plus an
associated `ui_vars.py` script, within the `ui/` directory. For example, the
`curses` UI launches a terminal-based simulation visualizer, allowing easy
exploration of *SALIS* memory cores and processes. In contrast, the `daemon` UI
provides minimal output, making it ideal for running *SALIS* as a background
service. Unlike the `--arch` argument, you can choose a different `--ui` argument
each time you load a saved simulation.
As an example, the following command will launch a new *SALIS* simulation with 4
copies of the `55a` ancestor organisms pre-compiled in each memory core. It will
use the `v1` architecture, run on 8 memory cores, with each core having a size
of 2^22 bytes. The PRNG seed is set to `123456789`:
```console
user@host$ ./salis.py new -A55a -av1 -c8 -C4 -m22 -nworld-1 -s123456789 -o
```
Use `Ctrl-C` to exit the simulator.
Upon exit, the simulation state will be automatically saved to
`${HOME}/.salis/world-1/`. As long as the contents of this directory are not
removed, you can reload the saved simulation with the following command:
```console
user@host$ ./salis.py load -n world-1 -o
```
## Data Server

*SALIS data server*
This project includes a web visualizer that plots live simulation data. A generic
set of plots is configured by default for all VM architectures. Each architecture
may expand on these by configuring its own set of plots. Once a simulation has been
created (i.e., exists in `${HOME}/.salis`), you may launch the data server with:
```console
user@host$ ./salis.py serve -n world-1
```
You should then be able to access the server at `http://localhost:8080`. The data
server may run regardless of whether the associated simulation is running or not.
> NOTE: this server implementation is very minimal and has no built-in security.
> Please do not put this on the internet! Only run the data server within secure
> networks that you own.
## Requirements
- C compiler
- Python
## Optional Dependencies
- SQLite
- Zlib
|