项目作者: deanveloper

项目描述 :
non-deterministic esolang
高级语言: Go
项目地址: git://github.com/deanveloper/alchemist.git
创建时间: 2019-06-16T08:54:56Z
项目社区:https://github.com/deanveloper/alchemist

开源协议:MIT License

下载


Alchemist

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.

Feature List

  • Working API
  • CLI app to run Alchemy files
  • Write tests

CLI Installation

Make sure you have Go installed, and run the following commands:

  1. go get github.com/deanveloper/alchemist/cmd
  2. mv ~/go/bin/cmd ~/go/bin/alchemist

And make sure you have ~/go/bin added to your PATH.

CLI Usage

  1. Usage: ./alchemist [flags]
  2. Flags:
  3. -i string
  4. input file to read rules from
  5. -r string
  6. rules to execute with, overrides -i
  7. -u string
  8. universe of atoms to start with
Examples of rule sets:

### Hello world

  1. ->OutHello, World!”


### Hello world (using ! to determine input universe)

  1. x->OutHello, World!”!x


### Countdown
  1. ->5x
    x->Outx
    0x->Out
    Liftoff


### Adder

  1. -> a+reqX+OutInput 1:”+Inx+OutInput 2:”+Iny
    x -> z
    y -> z
    a+0x+0y -> Out_z


### Fibonacci
  1. -> OutEnter 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