#turing #machine #discursif

cythan

The Cythan machine implementation in Rust

1 unstable release

0.1.0 Aug 25, 2020

#8 in #turing

Apache-2.0

7KB
64 lines

Cythan v3

Cythan is an abstract machine that has been created to be simpler than Turing's one. This is the Rust implementation of Cythan.

Why Rust ?

  • Blazingly fast performances
  • Low memory foot-print
  • Great ecosystem
  • Concurrency
  • Memory safety
  • WASM compilable

How to use Cythan in a project

Cargo.toml

[dependencies]
cythan = "*"

Example

let mut cythan = Cythan::new(vec![12,78,15,21,20]);
for _ in 0..20 {
    cythan.next();
}
println!("{}",cythan);

Have found a bug, want to contribute or had an idea ?

Go in the issue section and leave an issue or fix one!


lib.rs:

  • The Cythan machine emulator librairy.
  • The Cythan machine is a mathematical Turing Complete computer.
  • The machine is composed of one vector. Each value of the vector is a positive integer, "pointing" to another value.
  • For every iteration of the machine

    • The first case (the pointer), is incremented by 2.
    • The 2 cases pointed by the first case before the incrementation is "executed". In a pair of executed cases, the case that as for index the second value is set to the value of the case that have as index the first value
  • For instance, 1,5,3,0,0,999 will copy the content of the 5th case (999) into the 3rd one. The result after one iteration will be 3,5,3,999,0,999
  • Example

  • use cythan::Cythan;
  • let mut cythan = Cythan::new( vec![1,9,5,10,1,0,0,11,0,1,20,21] );
  • println!("Cythan start:{:?}",cythan);
  • for a in 0..10 {
  • cythan.next();
  • println!("Cythan iteration {}:{:?}",a,cythan)
  • }

No runtime deps