non-deterministic esolang
Alchemist is a non-deterministic programming language based on chemical reaction networks. More information here. This implementation is written in Go, the original implementation can be found here. I would suggest reading the original implementation’s README to learn about how this particular language works.
This particular implementation has an API, so it can be executed from other Go code. The documentation can be found here.
Make sure you have Go installed, and run the following commands:
go get github.com/deanveloper/alchemist/cmd
mv ~/go/bin/cmd ~/go/bin/alchemist
And make sure you have ~/go/bin
added to your PATH
.
Usage: ./alchemist [flags]
Flags:
-i string
input file to read rules from
-r string
rules to execute with, overrides -i
-u string
universe of atoms to start with
->Out“Hello, World!”
!
to determine input universe)
x->Out“Hello, World!”!x
- ->5x
x->Outx
0x->Out“Liftoff”
-> a+reqX+Out“Input 1:”+Inx+Out“Input 2:”+Iny
x -> z
y -> z
a+0x+0y -> Out_z
- -> Out“Enter how many numbers you wanna see:”+In_loop+b+setNext+Out“”+Out_”Fibonacci:”+Out_a+Out_b
loop+a+setNext -> loop+next+setNext
loop+b+setNext -> loop+next+setNext+saveB
loop+0a+0b+setNext -> Out_next+setA
loop+setA+saveB -> loop+setA+a
loop+setA+0saveB -> loop+setB
loop+setB+next -> loop+setB+b
loop+setB+0next -> loop+setNext