Crate sbrain [] [src]

Modules

specification

Structs

EvalResult

Represents the outcome of an evaluation by the SBrain VM.

SBrainVM

A virtual machine modelling the SBrain Turing machine. This machine implements the specification relatively strictly, providing exactly 216 (65536) data and instruction cells. Thus, all pointers are 16 bits and all data is 32 bits. The main deviation from the minimum specification is the jump stack, which is indefinitely expandable.

Enums

FlowAction

FlowAction allows the VM's execution engine to implement flow control. Because evaluation can only see a single instruction, it must use this struct to instruct the flow controller to perform flow control actions.

Functions

evaluate

Run the program represented by the given source on a new Semantic Brain VM. If Limit is None, this may never return; if it is Some(n), the machine will run for at most n cycles, then stop.

source_to_tapes

Given source code, create data and instruction tapes.

Type Definitions

MAddr

The type of a pointer to a cell.

MData

The type of a data cell